

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.
101. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 10 10. |
B. | The program will print the output 10 11. |
C. | The program will print the output 11 10. |
D. | The program will print the output 11 11. |
E. | It will result in a compile time error. |
Answer» E. It will result in a compile time error. | |
102. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 10 20. |
B. | The program will print the output 10 21. |
C. | The program will print the output 11 20. |
D. | The program will print the output 11 21. |
E. | It will result in a compile time error. |
Answer» C. The program will print the output 11 20. | |
103. |
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 10 20. |
C. | The program will print two garbage values. |
D. | The program will print the address of variable x1 and y1. |
Answer» C. The program will print two garbage values. | |
104. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 100 10. |
B. | The program will print the output 100 100. |
C. | The program will print the output 100 garbage. |
D. | The program will print two garbage values. |
E. | It will result in a compile time error. |
Answer» C. The program will print the output 100 garbage. | |
105. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 10 10. |
B. | The program will print the output 10 11. |
C. | The program will print the output 11 11. |
D. | The program will print the output 11 10. |
E. | It will result in a compile time error. |
Answer» C. The program will print the output 11 11. | |
106. |
What will be the output of the following program?
|
A. | 10 20 |
B. | 11 21 |
C. | Garbage Garbage |
D. | It will result in a compile time error. |
Answer» C. Garbage Garbage | |
107. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 5 6 7 8 9 10. |
B. | The program will print the output 5 6 7 8 9 10 7. |
C. | The program will print the output 5 7. |
D. | It will result in a compile time error. |
Answer» D. It will result in a compile time error. | |
108. |
Which of the following statement is correct about the program given below?
|
A. | The program will print output 2 6. |
B. | The program will print output 3 7. |
C. | The program will print output 4 8. |
D. | The program will print output 5 9. |
E. | The program will print output 6 10. |
Answer» D. The program will print output 5 9. | |
109. |
Which of the following statement is correct about the program given below?
|
A. | The program will print output 3 7. |
B. | The program will print output 4 8. |
C. | The program will print output 5 9. |
D. | The program will print output 6 10. |
E. | It will result in a compile time error. |
Answer» F. | |
110. |
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 0 1 2. |
D. | It will result in a compile time error. |
Answer» E. | |
111. |
Which of the following statement is correct about the program given below?
|
A. | The program will print the output 1 2 3 4 5. |
B. | The program will print the output 2 4 6 8 10. |
C. | The program will print the output 1 1 1 1 1. |
D. | It will result in a compile time error. |
Answer» E. | |
112. |
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 5 5 5 8. |
C. | The program will print the output 5 5 8 8. |
D. | The program will print the output 5 5 5 5. |
Answer» D. The program will print the output 5 5 5 5. | |
113. |
What will be the output of the following program?
|
A. | 2 3 6 |
B. | 4 4 7 |
C. | 4 5 8 |
D. | 3 4 6 |
Answer» C. 4 5 8 | |
114. |
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 64 9. |
C. | The program will print the output 64 10. |
D. | The program will print the output 64 11. |
Answer» E. | |
115. |
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. | Both 1 and 2 are incorrect. |
Answer» D. Both 1 and 2 are incorrect. | |
116. |
A reference is declared using the _____ symbol. |
A. | <i class="cpp-code">&&</i> |
B. | <i class="cpp-code">&</i> |
C. | <i class="cpp-code">||</i> |
D. | <i class="cpp-code">!</i> |
Answer» C. <i class="cpp-code">||</i> | |
117. |
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. | It will result in a compile time error. |
Answer» E. | |
118. |
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. | It will result in a compile time error. |
Answer» B. The program will print the output 81 80. | |
119. |
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. | It will result in a compile time error. |
Answer» C. The program will print the output 12 13. | |
120. |
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 49 49. |
Answer» E. | |
121. |
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. | The program will print the output 3. |
Answer» D. The program will print the output 3. | |
122. |
When are the Global objects destroyed? |
A. | When the control comes out of the block in which they are being used. |
B. | When the program terminates. |
C. | When the control comes out of the function in which they are being used. |
D. | As soon as local objects die. |
Answer» C. When the control comes out of the function in which they are being used. | |
123. |
Which constructor function is designed to copy objects of the same class type? |
A. | Create constructor |
B. | Object constructor |
C. | Dynamic constructor |
D. | Copy constructor |
Answer» E. | |
124. |
Copy constructor must receive its arguments by __________ . |
A. | either pass-by-value or pass-by-reference |
B. | only pass-by-value |
C. | only pass-by-reference |
D. | only pass by address |
Answer» D. only pass by address | |
125. |
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. | Both 1 and 2 are incorrect. |
Answer» C. Both 1 and 2 are correct. | |
126. |
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. | Both 1 and 2 are incorrect. |
Answer» E. | |
127. |
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. | Both 1 and 2 are incorrect. |
Answer» B. Only 2 is correct. | |
128. |
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. | Both 1 and 2 are incorrect. |
Answer» C. Both 1 and 2 are correct. | |
129. |
Reference is like a _____. |
A. | Pointer |
B. | Structure |
C. | Macro |
D. | Enum |
Answer» B. Structure | |
130. |
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. | Runtime exception. |
Answer» B. Preprocessing error. | |
131. |
Can a class have virtual destructor? |
A. | Yes |
B. | No |
Answer» B. No | |
132. |
A constructor that accepts __________ parameters is called the default constructor. |
A. | one |
B. | two |
C. | no |
D. | three |
Answer» D. three | |
133. |
Destructor has the same name as the constructor and it is preceded by ______ . |
A. | ! |
B. | ? |
C. | ~ |
D. | $ |
Answer» D. $ | |
134. |
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. | are destroyed |
Answer» B. inherit parent class | |
135. |
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. | Both 1 and 2 are incorrect. |
Answer» D. Both 1 and 2 are incorrect. | |
136. |
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. | Both 1 and 2 are incorrect. |
Answer» B. Only 2 is correct. | |
137. |
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. | Both A and C. |
Answer» D. Both A and C. | |
138. |
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. | Both 1 and 2 are incorrect. |
Answer» E. | |
139. |
Which of the following type of class allows only one object of it to be created? |
A. | Virtual class |
B. | Abstract class |
C. | Singleton class |
D. | Friend class |
Answer» D. Friend class | |
140. |
Which of the following is not the member of class? |
A. | Static function |
B. | Friend function |
C. | Const function |
D. | Virtual function |
Answer» C. Const function | |
141. |
Which of the following is not a type of constructor? |
A. | Copy constructor |
B. | Friend constructor |
C. | Default constructor |
D. | Parameterized constructor |
Answer» C. Default constructor | |
142. |
Which of the following concepts means determining at runtime what method to invoke? |
A. | Data hiding |
B. | Dynamic Typing |
C. | Dynamic binding |
D. | Dynamic loading |
Answer» D. Dynamic loading | |
143. |
Which of the following is the correct class of the object cout? |
A. | <i class="cpp-code">iostream</i> |
B. | <i class="cpp-code">istream</i> |
C. | <i class="cpp-code">ostream</i> |
D. | <i class="cpp-code">ifstream</i> |
Answer» D. <i class="cpp-code">ifstream</i> | |
144. |
Which of the following cannot be used with the keyword virtual? |
A. | class |
B. | member functions |
C. | constructor |
D. | destructor |
Answer» D. destructor | |
145. |
Which of the following functions are performed by a constructor? |
A. | Construct a new class |
B. | Construct a new object |
C. | Construct a new function |
D. | Initialize objects |
Answer» E. | |
146. |
Which one of the following options is correct about the statement given below? The compiler checks the type of reference in the object and not the type of object. |
A. | Inheritance |
B. | Polymorphism |
C. | Abstraction |
D. | Encapsulation |
Answer» C. Abstraction | |
147. |
Which of the following concepts means adding new components to a program as it runs? |
A. | Data hiding |
B. | Dynamic typing |
C. | Dynamic binding |
D. | Dynamic loading |
Answer» E. | |
148. |
Which of the following operator is overloaded for object cout? |
A. | <i class="cpp-code">>></i> |
B. | <i class="cpp-code"><<</i> |
C. | <i class="cpp-code">+</i> |
D. | <i class="cpp-code">=</i> |
Answer» C. <i class="cpp-code">+</i> | |
149. |
Which of the following is correct about class and structure? |
A. | class can have member functions while structure cannot. |
B. | class data members are public by default while that of structure are private. |
C. | Pointer to structure or classes cannot be declared. |
D. | class data members are private by default while that of structure are public by default. |
Answer» E. | |
150. |
Which of the following concepts means wrapping up of data and functions together? |
A. | Abstraction |
B. | Encapsulation |
C. | Inheritance |
D. | Polymorphism |
Answer» C. Inheritance | |