Skip to main content

Object Oriented Programming In C Plus Plus — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Object Oriented Programming In C Plus Plus — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
38
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
46 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
38

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/38 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 38
★ FPSC ★ PPSC

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

Question 2 of 38
★ FPSC ★ PPSC

Which keyword is used to make a class inheritable by other classes in C++?

Question 3 of 38
★ FPSC ★ PPSC

What is the purpose of destructors in C++?

Question 4 of 38
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include<iostream> using namespace std; class Base { public: Base() { cout<<"Constructing Base \n"; } virtual~Base() { cout<<"Destructing Base \n"; } }; class Derived: public Base { public: Derived() { cout<<"Constructing Derived \n"; } ~Derived() { cout<<"Destructing Derived \n"; } }; int main(void) { Derived *d = new Derived(); Base *b = d; delete b; return 0; }

Question 5 of 38
★ FPSC ★ PPSC

Which concept allows you to reuse the written code?

Question 6 of 38
★ FPSC ★ PPSC

What is virtual inheritance?

Question 7 of 38
★ FPSC ★ PPSC

How structures and classes in C++ differ?

Question 8 of 38
★ FPSC ★ PPSC

Which of the following class allows to declare only one object of it?

Question 9 of 38
★ FPSC ★ PPSC

Which of the following is correct about new and malloc? i. new is an operator whereas malloc is a function ii. new calls constructor malloc does not iii. new returns required pointer whereas malloc returns void pointer and needs to be typecast

Question 10 of 38
★ FPSC ★ PPSC

How run-time polymorphisms are implemented in C++?

Question 11 of 38
★ FPSC ★ PPSC

Out of the following, which is not a member of the class?

Question 12 of 38
★ FPSC ★ PPSC

What is the correct syntax of declaring array of pointers of integers of size 10 in C++?

Question 13 of 38
★ FPSC ★ PPSC

Which of the following explains Polymorphism?

Question 14 of 38
★ FPSC ★ PPSC

Which of the following feature of OOPs is not used in the following C++ code? class A { int i; public: void print(){cout<<"hello"<<i;} } class B: public A { int j; public: void assign(int a){j = a;} }

Question 15 of 38
★ FPSC ★ PPSC

Why references are different from pointers?

Question 16 of 38
★ FPSC ★ PPSC

Which of the following explains the overloading of functions?

Question 17 of 38
★ FPSC ★ PPSC

What is the difference between delete and delete[] in C++?

Question 18 of 38
★ FPSC ★ PPSC

What is the other name used for functions inside a class?

Question 19 of 38
★ FPSC ★ PPSC

Which of the following is an abstract data type?

Question 20 of 38
★ FPSC ★ PPSC

What happens if the following C++ statement is compiled and executed? int *ptr = NULL; delete ptr;

Question 21 of 38
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> using namespace std; class A { int a; A() { a = 5;} }; int main() { A *obj = new A; cout << obj->a; }

Question 22 of 38
★ FPSC ★ PPSC

Which of the following is not a type of Constructor?

Question 23 of 38
★ FPSC ★ PPSC

Which of the following cannot be a friend?

Question 24 of 38
★ FPSC ★ PPSC

How access specifiers in Class helps in Abstraction?

Question 25 of 38
★ FPSC ★ PPSC

Which of the following approach is used by C++?

Question 26 of 38
★ FPSC ★ PPSC

Which of the following provides a programmer with the facility of using object of a class inside other classes?

Question 27 of 38
★ FPSC ★ PPSC

Which concept means the addition of new components to a program as it runs?

Question 28 of 38
★ FPSC ★ PPSC

What does polymorphism in OOPs mean?

Question 29 of 38
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> using namespace std; class A{ public: A(){ cout<<"Constructor called\n"; } ~A(){ cout<<"Destructor called\n"; } }; int main(int argc, char const *argv[]) { A *a = new A[5]; delete a; return 0; }

Question 30 of 38
★ FPSC ★ PPSC

Wrapping data and its related functionality into a single entity is known as . . . . . . . .

Question 31 of 38
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include<iostream> using namespace std; class Base { public: Base() { cout<<"Constructing Base \n"; } ~Base() { cout<<"Destructing Base \n"; } }; class Derived: public Base { public: Derived() { cout<<"Constructing Derived \n"; } ~Derived() { cout<<"Destructing Derived \n"; } }; int main(void) { Derived *d = new Derived(); Base *b = d; delete b; return 0; }

Question 32 of 38
★ FPSC ★ PPSC

C++ is . . . . . . . .

Question 33 of 38
★ FPSC ★ PPSC

How compile-time polymorphisms are implemented in C++?

Question 34 of 38
★ FPSC ★ PPSC

What does modularity mean?

Question 35 of 38
★ FPSC ★ PPSC

How many types of polymorphism are there in C++?

Question 36 of 38
★ FPSC ★ PPSC

Which of the following shows multiple inheritances?

Question 37 of 38
★ FPSC ★ PPSC

What happens if a pointer is deleted twice in a program as shown in the following C++ statements? int *ptr = new int; delete ptr; delete ptr;

Question 38 of 38
★ FPSC ★ PPSC

Which of the following is correct about new and malloc?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →