1 ) Which one is not a correct variable type in C++ ?
A ) float ,
B ) int ,
C ) real ,
D ) double ,
Correct answers : - C ) real ,
2 ) Which operation is used as Logical 'AND' : -
A ) Operator-& ,
B ) Operator-&& ,
C ) Operator-|| ,
D ) Operator + ,
Correct answers : - B ) Operator-&& ,
3 ) The break statement is required in the default case of a switch selection structure to exit the structure properly .
A ) True ,
B ) False ,
Correct answers : - B ) False ,
4 ) Default constructor has ______ arguments .
A ) No argument ,
B ) One argument ,
C ) Two Argument ,
D ) None of the above ,
Correct answers : - A ) No argument ,
5 ) What will be the output of this program ?
Note : - Includes all required header files
using namespace std;
int max(int p, int q )
{
return ( p > q ? p : q );
}
int main()
{ int x = 25;
int y = 50;
cout << max(x, y );
return 0;
}
Single choice.
A ) 25 ,
B ) either 25 or 50 ,
C ) 50 ,
D ) None of the above ,
Correct answers : - C ) 50 ,
6 ) An array can store many different types of values .
A ) True ,
B ) False ,
Correct answers : - B ) False ,
7 ) What is size of void in bytes ?
A ) 0 ,
B ) 2 ,
C ) 1 ,
D ) 4 ,
Correct answers : - A ) 0 ,
8 ) Which of the following is not a type of constructor ?
A ) Copy constructor ,
B ) Friend constructor ,
C ) Default constructor ,
D ) Parameterized constructor ,
Correct answers : - B ) Friend constructor ,
9 ) The output of this code is ?
class base
{
public:
base()
{
cout<<"BCon";
}
~base()
{
cout<<"BDest ";
}
};
class derived: public base
{
public:
derived()
{ cout<<"DCon ";
}
~derived()
{ cout<<"DDest ";
}
};
int main()
{
derived object;
return 0;
}
Single choice.
A ) Dcon DDest ,
B ) Dcon DDest BCon BDest ,
C ) BCon DCon BDes DDest ,
D ) BCon DCon DDest BDest ,
Correct answers : - D ) BCon DCon DDest BDest ,
10 ) How are many minimum numbers of functions need to be presented in c++ ?
A ) 0 ,
B ) 1 ,
C ) 2 ,
D ) 3 ,
Correct answers : - B ) 1 ,
11 ) Predict the output : -
Float x= 3.1496;
cout << setprecision(2) << x;
Single choice.
A ) 3.14 ,
B ) 3.15 ,
C ) 3 ,
D ) 3.1 ,
Correct answers : - D ) 3.1 ,
12 ) The _______ program combines the output of the compiler with various library functions to produce an executable image .
A ) compiler ,
B ) loader ,
C ) linker ,
D ) debugger ,
Correct answers : - C ) linker ,
13 ) ______ operators have lower precedence to relational and arithmetic operators .
A ) Conditional ,
B ) Boolean ,
C ) Logical ,
D ) Relational ,
Correct answers : - D ) Relational ,
14 ) What is the scope of the variable declared in the user - defined function ?
A ) Whole program ,
B ) Only inside the {} block ,
C ) The main function ,
D ) None of the above ,
Correct answers : - B ) Only inside the {} block ,
0 Comments