

MCQOPTIONS
This section includes 226 Mcqs, each offering curated multiple-choice questions to sharpen your Engineering knowledge and support exam preparation. Choose a topic below to get started.
51. |
What is correct about the following program?
|
A. | The program will report compilation error. |
B. | The program will run successfully giving the output 66 65. |
C. | The program will run successfully giving the output 65 66. |
D. | The program will run successfully giving the output 66 65 65 131 196. |
E. | The program will produce the output 66 65 infinite number of times (or till stack memory overflow). |
Answer» D. The program will run successfully giving the output 66 65 65 131 196. | |
52. |
What will be the output of the following program?
|
A. | 10 10 20 20 |
B. | Garbage garbage 20 20 |
C. | 10 10 Garbage garbage |
D. | Garbage garbage Garbage garbage |
Answer» B. Garbage garbage 20 20 | |
53. |
Which of the following statement is correct about the program given below?
|
A. | The program will display 1. |
B. | The program will display 2. |
C. | The program will display 15. |
D. | The program will go into an infinite loop. |
E. | The program will report error on compilation. |
Answer» E. The program will report error on compilation. | |
54. |
What will be the output of the following program?
|
A. | 0 |
B. | 5 |
C. | 100 |
D. | -5 |
E. | None of these |
Answer» C. 100 | |
55. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 100. |
B. | The program will print the output 200. |
C. | The program will print the output Garbage-value. |
D. | The program will report compile time error. |
Answer» C. The program will print the output Garbage-value. | |
56. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 1 2. |
B. | The program will print the output 0 1. |
C. | The program will print the output 1 1. |
D. | The program will print the output 1. |
E. | The program will report compile time error. |
Answer» E. The program will report compile time error. | |
57. |
What will be the output of the following program?
|
A. | 2 4 |
B. | 6 8 |
C. | The program will report error on Compilation. |
D. | The program will report error on Linking. |
E. | The program will report error on Run-time. |
Answer» C. The program will report error on Compilation. | |
58. |
What will be the output of the following program?
|
A. | 2 |
B. | 3 |
C. | 5 |
D. | 8 |
Answer» C. 5 | |
59. |
Which of the following constructor is used in the program given below?
|
A. | Copy constructor |
B. | Simple constructor |
C. | Non-parameterized constructor |
D. | Default constructor |
Answer» E. | |
60. |
What will be the output of the following program?
|
A. | Base OK. Derived OK. |
B. | Base OK. Derived OK. Base DEL. |
C. | Base OK. Derived OK. Derived DEL. |
D. | Base OK. Derived OK. Derived DEL. Base DEL. |
E. | Base OK. Derived OK. Base DEL. Derived DEL. |
Answer» C. Base OK. Derived OK. Derived DEL. | |
61. |
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 1. |
C. | The program will print the output 2. |
D. | The program will print the output garbage value. |
E. | The program will report compile time error. |
Answer» F. | |
62. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 2 4. |
B. | The program will print the output 20 40. |
C. | The program will print the output 10 20. |
D. | The program will print the output 20 4.50. |
E. | The program will report compile time error. |
Answer» B. The program will print the output 20 40. | |
63. |
What will be the output of the following program?
|
A. | The program will print the output M = 130. |
B. | The program will print the output M = 195. |
C. | The program will print the output M = -21. |
D. | The program will print the output M = -61. |
E. | The program will report compile time error. |
Answer» E. The program will report compile time error. | |
64. |
What will be the output of the following program?
|
A. | 0 |
B. | 314 |
C. | 314.0000 |
D. | 200.0000 |
Answer» B. 314 | |
65. |
What will be the output of the following program?
|
A. | 1 2 |
B. | 10 20 |
C. | 11 22 |
D. | Garbage Garbage |
E. | The program will report compile time error. |
Answer» D. Garbage Garbage | |
66. |
What will be the output of the following program?
|
A. | 6 6 4 |
B. | 6 6 5 |
C. | 5 40 38 |
D. | 6 40 38 |
E. | 6 40 39 |
Answer» E. 6 40 39 | |
67. |
What will be the output of the following program?
|
A. | Base OK. Derived OK. |
B. | Base OK. Derived OK. Base DEL. |
C. | Base OK. Derived OK. Derived DEL. |
D. | Base OK. Derived OK. Derived DEL. Base DEL. |
E. | Base OK. Derived OK. Base DEL. Derived DEL. |
Answer» E. Base OK. Derived OK. Base DEL. Derived DEL. | |
68. |
What will be the output of the following program?
|
A. | 3 |
B. | 4 |
C. | 5 |
D. | Garbage-value |
E. | The program will report compile time error. |
Answer» C. 5 | |
69. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 76. |
B. | The program will print the output 108. |
C. | The program will print the output garbage value. |
D. | The program will report compile time error. |
Answer» B. The program will print the output 108. | |
70. |
What will be the output of the following program?
|
A. | Base OK. Derived OK. Derived DEL. |
B. | Base OK. Base OK. Derived OK. Derived DEL. |
C. | Base OK. Derived OK. Derived DEL. Derived DEL. |
D. | Base OK. Base OK. Derived OK. Derived DEL. Derived DEL. |
E. | The program will report compile time error. |
Answer» E. The program will report compile time error. | |
71. |
What is the technical word for the function ~IndiaBix() defined in the following program?
|
A. | Constructor |
B. | Destructor |
C. | Default Destructor |
D. | Function Template |
Answer» C. Default Destructor | |
72. |
What will be the output of the following program?
|
A. | Class A. |
B. | Class B. |
C. | Class C. |
D. | The program will report compile time error. |
Answer» B. Class B. | |
73. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 100. |
B. | The program will print the output 200. |
C. | The program will print the output 400. |
D. | The program will print the output Garbage-value. |
E. | The program will report compile time error. |
Answer» D. The program will print the output Garbage-value. | |
74. |
What will be the output of the following program?
|
A. | 0 |
B. | 1 |
C. | -1 |
D. | Garbage value |
Answer» B. 1 | |
75. |
What will be the output of the following program?
|
A. | 1 |
B. | 2 |
C. | 24 |
D. | 25 |
Answer» C. 24 | |
76. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output me!. |
B. | The program will print the output Wel. |
C. | The program will print the output !em. |
D. | The program will print the output Welcome!. |
E. | The program will result in a compile time error. |
Answer» C. The program will print the output !em. | |
77. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 1 2 3. |
B. | The program will print the output 2 3 4 . |
C. | The program will print the output 4 5 6. |
D. | The program will report compile time error. |
Answer» C. The program will print the output 4 5 6. | |
78. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 4 2.5. |
B. | The program will print the output 4. |
C. | The program will report runtime error. |
D. | The program will report compile time error. |
Answer» D. The program will report compile time error. | |
79. |
What will be the output of the following program?
|
A. | 0 |
B. | 5 |
C. | 10 |
D. | 15 |
E. | The program will report compile time error. |
Answer» E. The program will report compile time error. | |
80. |
What will be the output of the following program?
|
A. | The program will print the output 4. |
B. | The program will print the ASCII value of 4. |
C. | The program will print the output 0. |
D. | The program will print the output garbage. |
Answer» B. The program will print the ASCII value of 4. | |
81. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 100. |
B. | The program will print the output 200. |
C. | The program will print the output Garbage-value. |
D. | The program will report compile time error. |
Answer» B. The program will print the output 200. | |
82. |
What will be the output of the following program?
|
A. | 12 12 |
B. | 12 18 |
C. | 3 14 |
D. | 18 12 |
E. | Compilation fails. |
Answer» C. 3 14 | |
83. |
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 report compile time error. |
Answer» C. The program will print the output Garbage. | |
84. |
What will be the output of the following program?
|
A. | 45 22 |
B. | 46 22 |
C. | 45 23 |
D. | 46 23 |
Answer» B. 46 22 | |
85. |
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 report compile time error. |
Answer» E. | |
86. |
Which of the following statement is correct with respect to the use of friend keyword inside a class? |
A. | A private data member can be declared as a friend. |
B. | A class may be declared as a friend. |
C. | An object may be declared as a friend. |
D. | We can use friend keyword as a class name. |
Answer» C. An object may be declared as a friend. | |
87. |
Which of the following keywords is used to control access to a class member? |
A. | Default |
B. | Break |
C. | Protected |
D. | Asm |
Answer» D. Asm | |
88. |
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 report runtime error. |
Answer» B. The program will print the output Garbage-value. | |
89. |
What will be the output of the following program?
|
A. | 1234 |
B. | 4321 |
C. | 12344321 |
D. | 12341234 |
E. | 43211234 |
Answer» D. 12341234 | |
90. |
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 private. |
Answer» C. Destructor of base class should not be virtual. | |
91. |
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 object and a member of that class. |
Answer» E. | |
92. |
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 compile succesfully. |
Answer» E. | |
93. |
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 declaring it abstract using the virtual keyword. |
Answer» C. By declaring it abstract using the static keyword. | |
94. |
Which of the following function prototype is perfectly acceptable? |
A. | <i class="cpp-code">int Function(int Tmp = Show());</i> |
B. | <i class="cpp-code">float Function(int Tmp = Show(int, float));</i> |
C. | Both A and B. |
D. | <i class="cpp-code">float = Show(int, float) Function(Tmp);</i> |
Answer» B. <i class="cpp-code">float Function(int Tmp = Show(int, float));</i> | |
95. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 0 0 10. |
B. | The program will print the output 10 20 10. |
C. | The program will print the output 10 20 9. |
D. | It will result in a compile time error. |
Answer» C. The program will print the output 10 20 9. | |
96. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 5 6 10. |
B. | The program will print the output 6 6 10. |
C. | The program will print the output 6 6 12. |
D. | It will result in a compile time error. |
Answer» C. The program will print the output 6 6 12. | |
97. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 0 11 21. |
B. | The program will print the output 10 11 11. |
C. | The program will print the output 10 11 21. |
D. | The program will print the output 10 11 12. |
E. | It will result in a compile time error. |
Answer» C. The program will print the output 10 11 21. | |
98. |
What will be the output of the program given below?
|
A. | 0 |
B. | 10 |
C. | 20 |
D. | Garbage-value |
E. | It will result in a compile-time/run-time error. |
Answer» D. Garbage-value | |
99. |
Which of the following statement is correct about the program given below?
|
A. | It will result in a runtime error. |
B. | It will result in a compile time error. |
C. | The program will print the output 9 4. |
D. | The program will print the output 100 100. |
Answer» E. | |
100. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 50 50. |
B. | The program will print the two garbage values. |
C. | It will result in a compile time error. |
D. | The program will print nothing. |
Answer» E. | |