

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.
201. |
Destructor calls are made in which order of the corresponding constructor calls? |
A. | Reverse order |
B. | Forward order |
C. | Depends on how the object is constructed |
D. | Depends on how many objects are constructed |
Answer» B. Forward order | |
202. |
Which of the following never requires any arguments? |
A. | Member function |
B. | Friend function |
C. | Default constructor |
D. | <i class="cpp-code">const</i> |
E. | function |
Answer» D. <i class="cpp-code">const</i> | |
203. |
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. | All the argument will be the default argument. |
Answer» B. The first argument will be the default argument. | |
204. |
Which of the following provides a reuse mechanism? |
A. | Abstraction |
B. | Inheritance |
C. | Dynamic binding |
D. | Encapsulation |
Answer» C. Dynamic binding | |
205. |
Which one of the following options is correct? |
A. | Friend function can access public data members of the class. |
B. | Friend function can access protected data members of the class. |
C. | Friend function can access private data members of the class. |
D. | All of the above. |
Answer» E. | |
206. |
Which of the following statements is correct in C++? |
A. | Classes cannot have data as protected members. |
B. | Structures can have functions as members. |
C. | Class members are public by default. |
D. | Structure members are private by default. |
Answer» C. Class members are public by default. | |
207. |
Which of the following is used to make an abstract class? |
A. | Declaring it abstract using static keyword. |
B. | Declaring it abstract using virtual keyword. |
C. | Making at least one member function as virtual function. |
D. | Making at least one member function as pure virtual function. |
Answer» E. | |
208. |
Which of the following access specifier is used as a default in a class definition? |
A. | protected |
B. | public |
C. | private |
D. | friend |
Answer» D. friend | |
209. |
Which of the following keyword is used to overload an operator? |
A. | <i class="cpp-code">overload</i> |
B. | <i class="cpp-code">operator</i> |
C. | <i class="cpp-code">friend</i> |
D. | <i class="cpp-code">override</i> |
Answer» C. <i class="cpp-code">friend</i> | |
210. |
What will happen if a class is not having any name? |
A. | It cannot have a destructor. |
B. | It cannot have a constructor. |
C. | It is not allowed. |
D. | Both A and B. |
Answer» E. | |
211. |
Which inheritance type is used in the class given below? |
A. | Multilevel inheritance |
B. | Multiple inheritance |
C. | Hybrid inheritance |
D. | Hierarchical Inheritance |
Answer» C. Hybrid inheritance | |
212. |
Which of the following statements regarding inline functions is correct? |
A. | It speeds up execution. |
B. | It slows down execution. |
C. | It increases the code size. |
D. | Both A and C. |
Answer» E. | |
213. |
Which one of the following is correct about the statements given below?
|
A. | Only II is correct. |
B. | Both I and II are correct. |
C. | Only I is correct. |
D. | Both I and II are incorrect. |
Answer» D. Both I and II are incorrect. | |
214. |
Which of the following is an invalid visibility label while inheriting a class? |
A. | <i class="cpp-code">public</i> |
B. | <i class="cpp-code">private</i> |
C. | <i class="cpp-code">protected</i> |
D. | <i class="cpp-code">friend</i> |
Answer» E. | |
215. |
Which of the following operators cannot be overloaded? |
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» D. <i class="cpp-code">*</i> | |
216. |
Which one of the following is the correct way to declare a pure virtual function? |
A. | <i class="cpp-code">virtual void Display(void){0};</i> |
B. | <i class="cpp-code">virtual void Display = 0;</i> |
C. | <i class="cpp-code">virtual void Display(void) = 0;</i> |
D. | <i class="cpp-code">void Display(void) = 0;</i> |
Answer» D. <i class="cpp-code">void Display(void) = 0;</i> | |
217. |
Which of the following header file includes definition of cin and cout? |
A. | <i class="cpp-code">istream.h</i> |
B. | <i class="cpp-code">ostream.h</i> |
C. | <i class="cpp-code">iomanip.h</i> |
D. | <i class="cpp-code">iostream.h</i> |
Answer» E. | |
218. |
Which of the following is a mechanism of static polymorphism? |
A. | Operator overloading |
B. | Function overloading |
C. | Templates |
D. | All of the above |
Answer» E. | |
219. |
What happens if the base and derived class contains definition of a function with same prototype? |
A. | Compiler reports an error on compilation. |
B. | Only base class function will get called irrespective of object. |
C. | Only derived class function will get called irrespective of object. |
D. | Base class object will call base class function and derived class object will call derived class function. |
Answer» E. | |
220. |
Which of the following is correct about the statements given below?
|
A. | Only I is true. |
B. | Both I and II are false. |
C. | Only II is true. |
D. | Both I and II are true. |
Answer» C. Only II is true. | |
221. |
Which of the following are available only in the class hierarchy chain? |
A. | Public data members |
B. | Private data members |
C. | Protected data members |
D. | Member functions |
Answer» D. Member functions | |
222. |
Which of the following is not a type of inheritance? |
A. | Multiple |
B. | Multilevel |
C. | Distributive |
D. | Hierarchical |
Answer» D. Hierarchical | |
223. |
Which of the following is the correct way of declaring a function as constant? |
A. | <i class="cpp-code">const int ShowData(void) { /* statements */ }</i> |
B. | <i class="cpp-code">int const ShowData(void) { /* statements */ }</i> |
C. | <i class="cpp-code">int ShowData(void) const { /* statements */ }</i> |
D. | Both A and B |
Answer» D. Both A and B | |
224. |
Which of the following concepts is used to implement late binding? |
A. | Virtual function |
B. | Operator function |
C. | Const function |
D. | Static function |
Answer» B. Operator function | |
225. |
Which of the following factors supports the statement that reusability is a desirable feature of a language? |
A. | It decreases the testing time. |
B. | It lowers the maintenance cost. |
C. | It reduces the compilation time. |
D. | Both A and B. |
Answer» E. | |
226. |
Which of the following ways are legal to access a class data member using this pointer? |
A. | <i class="cpp-code">this->x</i> |
B. | <i class="cpp-code">this.x</i> |
C. | <i class="cpp-code">*this.x</i> |
D. | <i class="cpp-code">*this-x</i> |
Answer» B. <i class="cpp-code">this.x</i> | |