iGET

C++ Programming - MCQ Practice Questions

C++ MCQs — OOP, STL, pointers, templates for coding rounds & IT exams.

100 questions | 100% Free

Q.1Easy

What is the default access specifier for class members in C++?

Q.2Easy

Which keyword is used to create a derived class in C++?

Q.3Easy

What is the purpose of a virtual function in C++?

Q.4Easy

Which access specifier allows access from derived classes but not from outside?

Q.5Easy

What is the purpose of 'this' pointer in C++?

Q.6Easy

What happens when you try to access a private member of a class from outside?

Q.7Easy

In C++, which keyword is used to prevent a class from being inherited?

Q.8Easy

Which of the following best describes polymorphism in C++?

Q.9Easy

In C++, what is the correct syntax for a pure virtual function?

Q.10Easy

Which access specifier allows a derived class to access members of the base class?

Q.11Easy

In C++, what is the correct way to implement an interface-like behavior?

Q.12Easy

Which of the following is a key principle of Object-Oriented Programming that bundles data and methods together?

Q.13Easy

In C++, what is the default access specifier for members of a class?

Q.14Easy

Which of the following correctly describes a pure virtual function in C++?

Q.15Easy

In C++, an abstract class is a class that contains at least one _______.

Q.16Easy

What does the 'this' pointer represent in C++?

Q.17Easy

Which of the following best defines abstraction in OOP?

Q.18Easy

What is the correct syntax for inheriting from multiple base classes in C++?

Q.19Easy

What is the access specifier for class members that are accessible only within the same class?

Q.20Easy

In C++, when a derived class object is created, which constructor is called first?