

MCQOPTIONS
Saved Bookmarks
This section includes 4 Mcqs, each offering curated multiple-choice questions to sharpen your C++ Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
Which is the correct statement about pure virtual functions? |
A. | They should be defined inside a base class |
B. | Pure keyword should be used to declare a pure virtual function |
C. | Pure virtual function is implemented in derived classes |
D. | Pure virtual function cannot implemented in derived classes |
Answer» D. Pure virtual function cannot implemented in derived classes | |
2. |
Which is the correct syntax of defining a pure virtual function? |
A. | pure virtual return_type func(); |
B. | virtual return_type func() pure; |
C. | virtual return_type func() = 0; |
D. | virtual return_type func(); |
Answer» D. virtual return_type func(); | |
3. |
What is a pure virtual function in C++? |
A. | A virtual function defined in a base class |
B. | A virtual function declared in a base class |
C. | Any function in a class |
D. | A function without definition in a base class |
Answer» C. Any function in a class | |
4. |
What is an abstract class in C++? |
A. | Class specifically used as a base class with atleast one virtual functions |
B. | Class specifically used as a base class with atleast one pure virtual functions |
C. | Class from which any class is derived |
D. | Any Class in C++ is an abstract class |
Answer» C. Class from which any class is derived | |