Skip to main content

Introduction To C Plus Plus — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Introduction To C Plus Plus — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
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
Question 1 of 40
★ FPSC ★ PPSC

What is the output of the following code: cout << (5 > 2) ? "True" : "False";

Question 2 of 40
★ FPSC ★ PPSC

Which of the following is not a valid C++ identifier?

Question 3 of 40
★ FPSC ★ PPSC

What does the 'static' keyword mean when used with a global variable in C++?

Question 4 of 40
★ FPSC ★ PPSC

What is the output of the following code: cout << (5 < 2) ? "True" : "False"; in C++?

Question 5 of 40
★ FPSC ★ PPSC

What is the output of the following code: cout << "Hello\nWorld"; in C++?

Question 6 of 40
★ FPSC ★ PPSC

What will be the output of the following C++ code? #include <iostream> int main(int argc, char const *argv[]) { cout<<"Hello World"; return 0; }

Question 7 of 40
★ FPSC ★ PPSC

Which of the following operator(s) can be used with pointers? i. – only ii. +, * iii. +, – iv. +, -, * v. / vi. + only

Question 8 of 40
★ FPSC ★ PPSC

What is the extension of a C++ source file?

Question 9 of 40
★ FPSC ★ PPSC

Which of the following is not a fundamental data type in C++?

Question 10 of 40
★ FPSC ★ PPSC

What does the 'cin' object in C++ represent?

Question 11 of 40
★ FPSC ★ PPSC

What keyword is used to define a class in C++?

Question 12 of 40
★ FPSC ★ PPSC

In C++, what operator is used to allocate dynamic memory?

Question 13 of 40
★ FPSC ★ PPSC

What is the syntax for a single-line comment in C++?

Question 14 of 40
★ FPSC ★ PPSC

What function is used to output data to the console in C++?

Question 15 of 40
★ FPSC ★ PPSC

Which header file is needed to use the 'cin' and 'cout' objects in C++?

Question 16 of 40
★ FPSC ★ PPSC

What does the 'endl' manipulator do in C++?

Question 17 of 40
★ FPSC ★ PPSC

Which keyword is used to define a constant in C++?

Question 18 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 5, y = 2; cout << x / y;

Question 19 of 40
★ FPSC ★ PPSC

What is the correct way to declare a pointer in C++?

Question 20 of 40
★ FPSC ★ PPSC

What is the keyword used for inheritance in C++?

Question 21 of 40
★ FPSC ★ PPSC

What function is used to return the length of a string in C++?

Question 22 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 10; cout << "Value of x is: " << x++ << endl;?

Question 23 of 40
★ FPSC ★ PPSC

What is the result of the expression: sizeof(int) in C++?

Question 24 of 40
★ FPSC ★ PPSC

Which C++ feature allows a function to call itself?

Question 25 of 40
★ FPSC ★ PPSC

What is the correct syntax to dynamically allocate memory for an array of integers in C++?

Question 26 of 40
★ FPSC ★ PPSC

Which of the following is used to access the first element of an array in C++?

Question 27 of 40
★ FPSC ★ PPSC

What is the output of the following code: cout << (5 == 5.0); in C++?

Question 28 of 40
★ FPSC ★ PPSC

What is the purpose of the 'break' statement in a switch-case construct in C++?

Question 29 of 40
★ FPSC ★ PPSC

What is the correct way to include a C++ standard library header file named 'vector' in a C++ program?

Question 30 of 40
★ FPSC ★ PPSC

Which operator is used to access the member functions and variables of an object in C++?

Question 31 of 40
★ FPSC ★ PPSC

What is the output of the following code: cout << (10 / 4); in C++?

Question 32 of 40
★ FPSC ★ PPSC

What is the correct syntax to define a function named 'add' that takes two integers as parameters and returns their sum in C++?

Question 33 of 40
★ FPSC ★ PPSC

What does the 'new' operator return when memory allocation fails in C++?

Question 34 of 40
★ FPSC ★ PPSC

Which of the following is the correct syntax for declaring a pointer to an integer in C++?

Question 35 of 40
★ FPSC ★ PPSC

In C++, what is the purpose of the 'endl' manipulator?

Question 36 of 40
★ FPSC ★ PPSC

What is the result of the expression: sizeof(char) in C++?

Question 37 of 40
★ FPSC ★ PPSC

What does the 'const' keyword signify when used with a member function in a C++ class declaration?

Question 38 of 40
★ FPSC ★ PPSC

Which operator is used to dereference a pointer in C++?

Question 39 of 40
★ FPSC ★ PPSC

What is the correct way to include the C++ standard input/output library header file in a C++ program?

Question 40 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 5, y = 2; cout << x / y; in C++?

✓ 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 →