Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C++ code? #include <iostream> class Test { public: void fun(); }; static void Test::fun() { std::cout<<"fun() is static"; } int main() { Test::fun(); return 0; }
Q2
Which of the following is not a fundamental type is not present in C but present in C++?
Q3
A language which has the capability to generate new data types are called . . . . . . . .
Q4
What will be the output of the following C++ code? #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; }
Q5
Which of the following is correct?
Q6
Which of the following supports the concept that reusability is a desirable feature of a language?
Q7
What are the escape sequences?
Q8
How many types of polymorphism are there?
Q9
Which of the following operator is used with this pointer to access members of a class?
Q10
Const qualifier can be applied to which of the following? i. Functions inside a class ii. Arguments of a function iii. Static data members iv. Reference variables
Q11
What will be the output of the following C++ code? #include<stdio.h> int main(int argc, char const *argv[]) { char a = 'a'; printf("%d\n", (int)sizeof(a)); return 0; }
Q12
Which of the following is called insertion/put to operator?
Q13
Which of the following statement is correct?
Q14
What are the actual parameters in C++?
Q15
Which of the following is used to make an abstract class?
Q16
Which of the following feature is not provided by C?
Q17
Which of the following operator has left to right associativity?
Q18
What happens if the following program is compiled in both C and C++? #include<stdio.h> struct STRUCT { int static a; }; int main() { struct STRUCT s; return 0; }
Q19
What will be the output of the following C++ code? #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; }
Q20
What will be the output of the following C++ code? #include<iostream> using namespace std; int main () { int cin; cin >> cin; cout << "cin: " << cin; return 0; }
Q21
What happens if the following program is executed in C and C++? #include <stdio.h> void func(void) { printf("Hello"); } void main() { func(); func(2); }
Q22
Which of the following is a correct identifier in C++?
Q23
Which function is used to read a single character from the console in C++?
Q24
Which of the following is the correct syntax of including a user defined header files in C++?
Q25
Which of the following is correct?