Object Oriented Programming Using C Plus Plus — Part 1 MCQs with Explanations
Practice high-yield Computer Science & IT MCQs on Object Oriented Programming Using C Plus Plus — Part 1 with worked academic solutions for PPSC, FPSC, CSS, PMS, NTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
PPSC, FPSC, CSS...
Estimated Time
48 mins
Exam-Level PPSC FPSC CSS PMS NTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
You can use C++ as a procedural, as well as an object-oriented, language
Correct Answer: Option A — True
Detailed Academic Explanation:
A. True. C++ is a multi-paradigm programming language, which means it supports multiple programming paradigms, including procedural and object-oriented programming. Procedural programming is a programming paradigm that emphasizes the use of procedures or functions to organize the program into small, reusable blocks of code. C++ supports procedural programming through the use of functions, structures, and arrays. Object-oriented programming, on the other hand, is a programming paradigm that emphasizes the use of objects, which are instances of classes, to organize the program. C++ supports object-oriented programming through the use of classes, inheritance, polymorphism, and other object-oriented concepts. Thus, C++ can be used as both a procedural and an object-oriented language, depending on the needs of the programmer and the requirements of the problem being solved.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 2 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The use of the break statement in a switch statement is
Correct Answer: Option A — optional
Detailed Academic Explanation:
Correct Answer: A: optional Here's why: In a `switch` statement, the `break` statement is optional . How a `switch` works (Simplified): A `switch` statement checks a variable against different `case` values. If a `case` matches, the code under that `case` starts executing. `break`'s role: The `break` statement tells the program to immediately exit the `switch` statement . What happens without `break`? If you *don't* include a `break` after a `case`, the program will "fall through" to the next `case` and continue executing code there, even if that next `case` doesn't match the original variable's value. This "fall-through" behavior can be useful in some situations, but often you want to execute only the code associated with a single `case`. Example: Imagine a traffic light. `switch (trafficLightColor)` { `case "red":` `Stop();` `break;` // Without this, it might also execute the "yellow" code! `case "yellow":` `SlowDown();` `break;` `case "green":` `Go();` `break;` `}` So, while `break` is very common and important for controlling the flow of execution in a `switch`, it's not required by the C++ language . The program will still compile and run (though perhaps not as intended) without it.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 3 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Evaluate the following expression: 4 >6 || 10 < 2 * 6
Correct Answer: Option A — True
Detailed Academic Explanation:
In the given expression, we have two conditions connected by the logical OR operator ( || ): - 4 > 6 : This condition is false because 4 is not greater than 6. - 10 < 2 * 6 : This condition is true because 10 is less than 12 (2 multiplied by 6). The logical OR operator ( || ) returns true if at least one of the conditions is true. In this case, the second condition is true, so the overall expression is true. So, the correct answer is Option A: True .
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 4 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A static data member is given a value
Correct Answer: Option B — outside the class definition
Detailed Academic Explanation:
Static data members in C++ are special variables associated with a class, not individual objects of that class. This means there's only one copy of the static member shared by all objects of the class. Because of this shared nature, you can't initialize them directly within the class declaration like regular member variables. Instead, you need to give them a value outside the class definition. This is done typically by providing an initialization outside the class, often in the same header file or a separate source file. Therefore, the correct answer is that a static data member is given a value outside the class definition .
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 5 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is the insertion operator?
Correct Answer: Option B — <<
Detailed Academic Explanation:
The insertion operator in C++ is used to insert data into an output stream, such as cout . Option A: >> - This is the extraction operator, used to extract data from an input stream, such as cin . Option B: << - This is the insertion operator, used to insert data into an output stream, such as cout . Option C: // - This denotes a single-line comment in C++. Option D: / - This denotes the beginning of a multi-line comment in C++, which ends with / . Option E: both (a) and (b) - This is incorrect because only Option B: << is the insertion operator. Therefore, the correct answer is Option B: << .
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 6 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following C++ expressions will find the square root of the number 16?
Correct Answer: Option D — sqrt (16)
Detailed Academic Explanation:
sqrt is a function from the C++ standard library that calculates the square root of a given number. In this case, the expression sqrt(16) calculates the square root of 16. The function pow from the C++ standard library calculates the power of a number, i.e., it raises a number to a specified power. The expression pow(16, 2) calculates 16 raised to the power of 2, which is 256, and is not the square root of 16. sqroot is not a standard C++ function and will result in a compile-time error. sqrt (16, 2) is not a correct syntax for the sqrt function in C++, which takes only one argument, the number for which the square root is to be calculated. So, the correct expression to find the square root of 16 in C++ is sqrt(16) . C++ program to find out square root of 16 #include <iostream> #include <cmath> using namespace std; int main() { cout << "Square root of 16 = "; // print the square root of 16 cout << sqrt(16); return 0; } Here is an explanation of the code: 1. #include <iostream> - This line includes the input/output stream library, which provides the cout function that is used later in the code to print the output. 2. #include <cmath> - This line includes the C++ mathematics library, which provides mathematical functions such as sqrt() that is used later in the code to calculate the square root. 3. using namespace std; - This line is used to make all the elements of the standard C++ library available to the program. 4. int main() - This is the main function of the program. All C++ programs must have a main function, which is where the program starts executing. 4. cout << "Square root of 16 = "; - This line outputs the string "Square root of 16 =" to the console. 6. cout << sqrt(16); - This line calculates the square root of 16 using the sqrt() function from the C++ mathematics library and outputs the result to the console. 7. return 0; - This line is the return statement of the main function. It returns 0, indicating that the program has executed successfully. In summary, this program calculates the square root of 16 and outputs the result to the console.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 7 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A default catch block catches
Correct Answer: Option C — any thrown object that has not been caught by an earlier catch block
Detailed Academic Explanation:
any thrown object that has not been caught by an earlier catch block is the correct answer to “A default catch block catches”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 8 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Adding a derived class to a base class requires fundamental changes to the base class
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “Adding a derived class to a base class requires fundamental changes to the base class”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 9 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Format flags may be combined using
Correct Answer: Option A — the bitwise OR operator (|)
Detailed Academic Explanation:
the bitwise OR operator (|) is the correct answer to “Format flags may be combined using”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 10 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
To expose a data member to the program, you must declare the data member in the _____ section of the class
Correct Answer: Option C — public
Detailed Academic Explanation:
public is the correct answer to “To expose a data member to the program, you must declare the data member in the _____ section of the class”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 11 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Evaluate the following expression: 3 >6&&7>4
Correct Answer: Option B — False
Detailed Academic Explanation:
False is the correct answer to “Evaluate the following expression: 3 >6&&7>4”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 12 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following are valid characters for a numeric literal constant?
Correct Answer: Option E — None of the above
Detailed Academic Explanation:
None of the above is the correct answer to “Which of the following are valid characters for a numeric literal constant”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 13 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A function that changes the state of the cout object is called a(n) _____
Correct Answer: Option C — manipulator
Detailed Academic Explanation:
manipulator is the correct answer to “A function that changes the state of the cout object is called a(n) _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 14 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A C++ program contains a function with the header int function(double d, char c). Which of the following function headers could be used within the same program?
Correct Answer: Option B — int function(int d, char c)
Detailed Academic Explanation:
int function(int d, char c) is the correct answer to “A C++ program contains a function with the header int function(double d, char c). Which of the following function headers could be used within the same program”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 15 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When the compiler cannot differentiate between two overloaded constructors, they are called
Correct Answer: Option C — ambiguous
Detailed Academic Explanation:
ambiguous is the correct answer to “When the compiler cannot differentiate between two overloaded constructors, they are called”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 16 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Some Streams work with input, and some with output
Correct Answer: Option A — True
Detailed Academic Explanation:
True is the correct answer to “Some Streams work with input, and some with output”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 17 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
If you design a class that needs special initialization tasks, you will want to design a(n) _____
Correct Answer: Option C — constructor
Detailed Academic Explanation:
constructor is the correct answer to “If you design a class that needs special initialization tasks, you will want to design a(n) _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 18 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which type of statement does not occur in computer programs?
Correct Answer: Option C — denial
Detailed Academic Explanation:
denial is the correct answer to “Which type of statement does not occur in computer programs”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 19 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The newline character is always included between
Correct Answer: Option C — control string
Detailed Academic Explanation:
control string is the correct answer to “The newline character is always included between”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 20 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
To be called object-oriented, a programming language must allow
Correct Answer: Option C — inheritance
Detailed Academic Explanation:
inheritance is the correct answer to “To be called object-oriented, a programming language must allow”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 21 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A function that returns no values to the program that calls it is _____
Correct Answer: Option B — type void
Detailed Academic Explanation:
type void is the correct answer to “A function that returns no values to the program that calls it is _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 22 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The keyword used to define a structure is _____
Correct Answer: Option C — struct
Detailed Academic Explanation:
struct is the correct answer to “The keyword used to define a structure is _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 23 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
If container classes are carefully constructed, then these tools are available to work with structures that are not ______
Correct Answer: Option C — type-specific
Detailed Academic Explanation:
type-specific is the correct answer to “If container classes are carefully constructed, then these tools are available to work with structures that are not ______”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 24 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Header files often have the file extension _____
Correct Answer: Option A — .H
Detailed Academic Explanation:
.H is the correct answer to “Header files often have the file extension _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 25 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The #ifndef directive tests to see whether ________
Correct Answer: Option A — a class has been defined
Detailed Academic Explanation:
a class has been defined is the correct answer to “The #ifndef directive tests to see whether ________”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 26 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The generic type in a template function
Correct Answer: Option B — can be T
Detailed Academic Explanation:
can be T is the correct answer to “The generic type in a template function”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 27 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When a child class function is called, the compiler looks first for a matching function name in the _____
Correct Answer: Option A — class of the object using the function name
Detailed Academic Explanation:
class of the object using the function name is the correct answer to “When a child class function is called, the compiler looks first for a matching function name in the _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 28 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
A function that is called automatically each time an object is destroyed is a
Correct Answer: Option B — destructor
Detailed Academic Explanation:
destructor is the correct answer to “A function that is called automatically each time an object is destroyed is a”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 29 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
If you create an instantiation of a class template with an int, and then create a second instantiation with a double, then
Correct Answer: Option A — you must precede each function call with the word int or double
Detailed Academic Explanation:
you must precede each function call with the word int or double is the correct answer to “If you create an instantiation of a class template with an int, and then create a second instantiation with a double, then”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 30 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The type to be used in an instantiation of a class template follows ________
Correct Answer: Option A — the generic class name
Detailed Academic Explanation:
the generic class name is the correct answer to “The type to be used in an instantiation of a class template follows ________”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 31 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following statements allows the user to enter data at the keyboard?
Correct Answer: Option B — cin >> currentPay
Detailed Academic Explanation:
cin >> currentPay is the correct answer to “Which of the following statements allows the user to enter data at the keyboard”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 32 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
When you pass a variable _____, C++ passes only the contents of the variable to the receiving function
Correct Answer: Option B — by value
Detailed Academic Explanation:
by value is the correct answer to “When you pass a variable _____, C++ passes only the contents of the variable to the receiving function”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 33 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
The best form of coupling is _____
Correct Answer: Option C — loose
Detailed Academic Explanation:
loose is the correct answer to “The best form of coupling is _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 34 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Paying attention to the important properties while ignoring inessential details is known as________
Correct Answer: Option C — abstraction
Detailed Academic Explanation:
abstraction is the correct answer to “Paying attention to the important properties while ignoring inessential details is known as________”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 35 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
What does C++ append to the end of a string literal constant?
Correct Answer: Option D — a null character
Detailed Academic Explanation:
a null character is the correct answer to “What does C++ append to the end of a string literal constant”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 36 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
An array name is a _____
Correct Answer: Option C — memory address
Detailed Academic Explanation:
memory address is the correct answer to “An array name is a _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 37 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
To enter a comment in a C++ program, you begin the comment with _____
Correct Answer: Option E — //
Detailed Academic Explanation:
// is the correct answer to “To enter a comment in a C++ program, you begin the comment with _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 38 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Which of the following is(are) invalid string constant(s)?
Correct Answer: Option A — "7.15 pm"
Detailed Academic Explanation:
"7.15 pm" is the correct answer to “Which of the following is(are) invalid string constant(s)”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 39 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
You define a structure type globally because _____
Correct Answer: Option A — you save many lines of code by not rewriting an identical structure definition in each function that uses it
Detailed Academic Explanation:
you save many lines of code by not rewriting an identical structure definition in each function that uses it is the correct answer to “You define a structure type globally because _____”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
Question 40 of 40
★ PPSC
★ FPSC
★ PPSC
★ FPSC
Overloaded functions are required to
Correct Answer: Option D — None of the above
Detailed Academic Explanation:
None of the above is the correct answer to “Overloaded functions are required to”. This question is standard in competitive examination syllabi for Object Oriented Programming Using C Plus Plus.
💡Key Conceptual Anchor:Object Oriented Programming Using C Plus Plus
✓Link copied to clipboard
Continue Your Practice
Advanced Mapreduce Concepts — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
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.