C++ Programming :: All Aptitude Test ::

1.What will be the output of the following program?
A. -6
B. -8
C. 6
D. -6

2.What will be the output of the program?
A. a = 20 b = 40
B. a = 20 b = 30
C. a = 20 b = Garbage
D. a = 20 b = 40

3.What will be the output of the program?
A. The program will print the output 10 20.
B. The program will print the output 10 0.
C. The program will print the output 10 garbage.
D. The program will print the output 10 20.

4.What will be the output of the program?
A. 20
B. 30
C. 40
D. 20

5.What happens when we try to compile the class definition in following code snippet?
A. It will not compile because class body of Birds is not defined.
B. It will not compile because class body of Peacock is not defined.
C. It will not compile because a class cannot be protectedly inherited from other class.
D. It will not compile because class body of Birds is not defined.

6.Which of the following statements is incorrect?
A. Friend keyword can be used in the class to allow access to another class.
B. Friend keyword can be used for a function in the public section of a class.
C. Friend keyword can be used for a function in the private section of a class.
D. Friend keyword can be used in the class to allow access to another class.

7.Which of the following statement is correct regarding destructor of base class?
A. Destructor of base class should always be static.
B. Destructor of base class should always be virtual.
C. Destructor of base class should not be virtual.
D. Destructor of base class should always be static.

8.Which of the following two entities (reading from Left to Right) can be connected by the dot operator?
A. A class member and a class object.
B. A class object and a class.
C. A class and a member of that class.
D. A class member and a class object.

9.How can we make a class abstract?
A. By making all member functions constant.
B. By making at least one member function as pure virtual function.
C. By declaring it abstract using the static keyword.
D. By making all member functions constant.

10.What will be the output of the program?
A. 10 10 20 20
B. Garbage garbage 20 20
C. 10 10 Garbage garbage
D. 10 10 20 20

11.Which of the following statement is correct about the program given below?
A. The program will print the output 0.
B. The program will print the output 33.
C. The program will print the output Garbage.
D. The program will print the output 0.

12.Which of the following statement is correct about the program given below?
A. The program will print the output 0.
B. The program will print the output 44.
C. The program will print the output Garbage.
D. The program will print the output 0.

13.What will be the output of the following program?
A. 45 22
B. 46 22
C. 45 23
D. 45 22

14.Which of the following statement is correct about the program given below?
A. The program will print the output 0.
B. The program will print the output 22.
C. The program will print the output Garbage.
D. The program will print the output 0.


Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers