Observe following program and answer 100 class Example{public: int a,b,c; Example(){a=b=c=1;} //Constructor 1 Example(int a){a = a; b = c = 1;} //Constructor 2 Example(int a,int b){a = a; b = b; c = 1;} //Constructor 3 Example(int a,int b,int c){ a = a; b = b; c = c;} //Constructor 4 } In the above example of constructor overloading, the following statement will call which constructor Example obj = new Example (1,2,3);
What will be the output of this program? 1.#include
2.using namespace std;
3. int main()
4.{
5.char c = 74;
6.cout << c;
7.return 0;
8.}
What is the output of this program? 1.include
2.using namespace std;
3.int g = 100;
4.int main()
5.{
6.int a;
7.{
8.int b;
9.b = 20;
10.a = 35;
11.g = 65;
12.cout << b << a << g;
13.}
14.a = 50;
15.cout << a << g;
16.return 0;
17.}
In C++, what is the sign of character data type by default?
Which of the following belongs to the set of character types?
The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is
96. The output of this program is int main () { cout << "Hello World!" return 0; }
What will happen in this code? int a = 100, b = 200;
int *p = &a, *q = &b;
p = q;
Which of the two operators ++ and — work for the bool datatype in C++?
Which of the following will not return a value?
What is the output of the following program? 1.#include
2.using namespace std;
3.int main()
4.{
5.float i = 123.0f;
6.cout << i << endl;
7.return 0;
8.}
What is the difference between overloaded functions and overridden functions?
The difference between x and ‘x’ is
How to declare a wide character in string literal?
Suppose in a hypothetical machine, the size of char is 32 bits. What would sizeof(char) return?
Which of the following members do get inherited but become private members in child class
What is the output of this program? 1.#include
2.using namespace std;
3.enum cat {
4.temp = 7
5.};
6.int main()
7.{
8.int age = 14;
9.age /= temp;
10.cout << "If you were cat, you would be " << age << endl;
11.return 0;
12.}
What will be the output of this program? 1.#include
2.using namespace std;
3.int array1[] = {1200, 200, 2300, 1230, 1543};
4.int array2[] = {12, 14, 16, 18, 20};
5.int temp, result = 0;
6.int main()
7.{
8.for (temp = 0; temp < 5; temp++) {
9.result += array1[temp];
10.}
11.for (temp = 0; temp < 4; temp++) {
12.result += array2[temp];
13.}
14.cout << result;
15.return 0;
16.}
In which type does the enumerators are stored by the compiler?
What are the parts of the literal constants?
Which of the following statements are false?
Choose the incorrect option
Which of the following is the most preferred way of throwing and handling exceptions?
The return value of the following code is Class1& test(Class1 obj) Class1 *ptr = new Class1(); _________ return ptr;
When a language has the capability to produce new data type mean, it can be called as
Identify the incorrect statements.
int var = 10;
int *ptr = &(var + 1); //statement 1
int *ptr2 = &var; //statement 2
&var = 40; //statement 3
What will be the output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int a = 8;
6.cout << "ANDing integer 'a' with 'true' :" << a && true;
7.return 0;
8.}
Which of the following is a valid destructor of the class name “Country”
What is the output of this program? 1.include
2.using namespace std;
3.int main()
4.{
5.int a = 9;
6.int & aref = a;
7.a++;
8.cout << "The value of a is " << aref;
9.return 0;
10.}
Which of the following operator cannot be overloaded?
Which of the STL containers store the elements contiguously (in adjacent memory locations)?
If the class name is X, what is the type of its “this” pointer (in a nonstatic, non-const member function)?
Evaluate the following (false && true) || false || true
What will be output of this program? 1.#include
2.using namespace std;
3.int main()
4.{
5.int i = 3;
6.int l = i / -2;
7.int k = i % -2;
8.cout << l << k;
9.return 0;
10.}
Which of the following relationship is known as inheritancerelationship?
Identify the incorrect statement
Which of the following correctly describes the meaning of‘namespace’ feature in C++?