C++ Programming :: All Aptitude Test ::

1.Which of the following type of class allows only one object of it to be created?
A. Friend class
B. Singleton class
C. Abstract class
D. Friend class

2.Which of the following is not a type of constructor?
A. Parameterized constructor
B. Default constructor
C. Friend constructor
D. Parameterized constructor

3.Which of the following statements is correct?
A. Pointer to base class cannot be created.
B. Pointer to derived class cannot be created.
C. Derived class pointer cannot point to base class.
D. Pointer to base class cannot be created.

4.Which of the following is not the member of class?
A. Virtual function
B. Const function
C. Friend function
D. Virtual function

5.Which of the following concepts means determining at runtime what method to invoke?
A. Data hiding
B. Dynamic Typing
C. Dynamic binding
D. Data hiding

6.Which of the following statement is correct?
A. A reference is stored in a binary tree.
B. A reference is stored in a queue.
C. A reference is stored on stack.
D. A reference is stored in a binary tree.

7.Which of the following statements is correct?
A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Only 1 is correct.

8.Functions can be declared to return a reference type. There are reasons to make such a declaration/Which of the following reasons are correct?
A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Only 1 is correct.

9.Which of the following statements is correct?
A. Only 1 is correct.
B. Only 2 is correct.
C. Both 1 and 2 are correct.
D. Only 1 is correct.

10.Which of the following statement is correct about the references?
A. A reference must always be initialized within functions.
B. A reference must always be initialized outside all functions.
C. A reference must always be initialized.
D. A reference must always be initialized within functions.

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

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

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

14.Which of the following statement is correct about the program given below?
A. The program will print the output 25 49.
B. It will result in a compile time error.
C. The program will print the output 50 50.
D. The program will print the output 25 49.

15.Which of the following statement is correct about the program given below?
A. It will result in a compile time error.
B. The program will print the output 1.
C. The program will print the output 2.
D. It will result in a compile time error.

16.A constructor that accepts parameters is called the default constructor?
A. one
B. two
C. three
D. one

17.What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero-argument constructor?
A. Compile-time error.
B. Preprocessing error.
C. Runtime error.
D. Compile-time error.

18.Can a class have virtual destructor?
A. Yes
B. No
C. Both
D. Yes

19.Destructor has the same name as the constructor and it is preceded by?
A. !
B. ?
C. ~
D. !

20.For automatic objects, constructors and destructors are called each time the objects?
A. enter and leave scope
B. inherit parent class
C. are constructed
D. enter and leave scope

21.What will be the output of the program?
A. 99.50
B. Garbage value
C. ASCII value of 99
D. 99.50

22.Which of the following statement is correct about the program given below?
A. The program will print the output Pak
B. The program will print the output Mcqs
C. The program will print the output PakMcqs
D. The program will print the output Pak

23.Which of the following statement is correct about the program given below?
A. The program will print the output 25.
B. The program will print the output Garbage-value.
C. The program will report compile time error.
D. The program will print the output 25.

24.Which of the following statement is correct about the program given below?
A. The program will print the output 5.
B. The program will print the output Garbage-value.
C. The program will report compile time error.
D. The program will print the output 5.

25.What will be the output of the program ?
A. 1234
B. 4321
C. 12344321
D. 1234

26.Which of the following function prototype is perfectly acceptable?
A. int Function(int Tmp = Show());
B. float Function(int Tmp = Show(int, float));
C. Both A and B.
D. int Function(int Tmp = Show());

27.Which of the following statement is correct?
A. C++ enables to define functions that take constants as an argument.
B. We cannot change the argument of the function that that are declared as constant.
C. Both A and B.
D. C++ enables to define functions that take constants as an argument.

28.Which of the following statement is correct?
A. Overloaded functions can have at most one default argument.
B. An overloaded function cannot have default argument.
C. All arguments of an overloaded function can be default.
D. Overloaded functions can have at most one default argument.

29.Which of the following statement will be correct if the function has three arguments passed to it?
A. The trailing argument will be the default argument.
B. The first argument will be the default argument.
C. The middle argument will be the default argument.
D. The trailing argument will be the default argument.

30.What will be the output of the program?
A. 237
B. 242
C. 240
D. 237


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