Q101
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
138
Questions
6/7
Page
Pick an option on a question to see the right answer and solution.
Q101
Open questionSelect an option to see the answer and solution.
Q102
Open questionSelect an option to see the answer and solution.
Q103
Open question#include<iostream>
using namespace std;
class Test
{
private:
static int count;
public:
Test& fun();
};
int Test::count = 0;
Test& Test::fun()
{
Test::count++;
cout << Test::count << " ";
return *this;
}
int main()
{
Test t;
t.fun().fun().fun().fun();
return 0;
}Select an option to see the answer and solution.
Q104
Open questionSelect an option to see the answer and solution.
Q105
Open questionSelect an option to see the answer and solution.
Q106
Open question#include<stdio.h>
struct STRUCT
{
int static a;
};
int main()
{
struct STRUCT s;
return 0;
}Select an option to see the answer and solution.
Q107
Open question#include <iostream>
using namespace std;
class Player
{
private:
int id;
static int next_id;
public:
int getID() { return id; }
Player() { id = next_id++; }
};
int Player::next_id = 1;
int main()
{
Player p1;
Player p2;
Player p3;
cout << p1.getID() << " ";
cout << p2.getID() << " ";
cout << p3.getID();
return 0;
}Select an option to see the answer and solution.
Q108
Open questionSelect an option to see the answer and solution.
Q109
Open questionSelect an option to see the answer and solution.
Q110
Open questionSelect an option to see the answer and solution.
Q111
Open questionSelect an option to see the answer and solution.
Q112
Open questionSelect an option to see the answer and solution.
Q113
Open questionSelect an option to see the answer and solution.
Q114
Open questionSelect an option to see the answer and solution.
Q115
Open question#include <iostream>
class Test
{
public:
void fun();
};
static void Test::fun()
{
std::cout<<"fun() is static";
}
int main()
{
Test::fun();
return 0;
}Select an option to see the answer and solution.
Q116
Open questionSelect an option to see the answer and solution.
Q117
Open questionSelect an option to see the answer and solution.
Q118
Open questionSelect an option to see the answer and solution.
Q119
Open question#include <stdio.h>
void func(void)
{
printf("Hello");
}
void main()
{
func();
func(2);
}Select an option to see the answer and solution.
Q120
Open questionSelect an option to see the answer and solution.