Skip to main content

Control Flow Statements In C Plus Plus — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Control Flow Statements In 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 will be the output of the following code: for (int i = 5; i >= 0; --i) { cout << i << " "; if (i == 3) break; } in C++?

Question 2 of 40
★ FPSC ★ PPSC

What is the output of the following code: for (int i = 0; i < 3; ++i) { for (int j = 0; j < 2; ++j) { cout << i << j << " "; } } in C++?

Question 3 of 40
★ FPSC ★ PPSC

What will be the output of the following code: int x = 10; if (x < 5) cout << "Less"; else if (x == 5) cout << "Equal"; else cout << "More"; in C++?

Question 4 of 40
★ FPSC ★ PPSC

What is the syntax for the 'if' statement in C++?

Question 5 of 40
★ FPSC ★ PPSC

What is the purpose of the 'else' statement in C++?

Question 6 of 40
★ FPSC ★ PPSC

What is the correct syntax for the 'switch' statement in C++?

Question 7 of 40
★ FPSC ★ PPSC

What will be the output of the following code: int x = 10; if (x > 5) cout << "Hello"; else cout << "Goodbye"; in C++?

Question 8 of 40
★ FPSC ★ PPSC

What does the 'break' statement do in a loop in C++?

Question 9 of 40
★ FPSC ★ PPSC

What is the correct syntax for the 'while' loop in C++?

Question 10 of 40
★ FPSC ★ PPSC

What will be the output of the following code: int i = 0; while (i < 5) { cout << i << " "; i++; } in C++?

Question 11 of 40
★ FPSC ★ PPSC

What is the purpose of the 'default' case in a 'switch' statement in C++?

Question 12 of 40
★ FPSC ★ PPSC

What is the syntax for the 'do-while' loop in C++?

Question 13 of 40
★ FPSC ★ PPSC

In C++, what is the difference between the 'while' loop and the 'do-while' loop?

Question 14 of 40
★ FPSC ★ PPSC

What is the purpose of the 'if-else if-else' statement in C++?

Question 15 of 40
★ FPSC ★ PPSC

What will be the output of the following code: for (int i = 0; i < 3; ++i) { for (int j = 0; j < 2; ++j) { cout << i << j << " "; } }?

Question 16 of 40
★ FPSC ★ PPSC

What is the syntax for the 'if-else' statement in C++?

Question 17 of 40
★ FPSC ★ PPSC

What does the 'else if' statement allow in C++?

Question 18 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 10; if (x == 10) { cout << "x is 10"; } else { cout << "x is not 10"; } in C++?

Question 19 of 40
★ FPSC ★ PPSC

What is the purpose of the 'continue' statement in a loop in C++?

Question 20 of 40
★ FPSC ★ PPSC

What will be the output of the following code: int i = 0; while (i < 3) { cout << i << " "; i++; } in C++?

Question 21 of 40
★ FPSC ★ PPSC

What will be the output of the following code: for (int i = 0; i < 5; ++i) { if (i == 2) continue; cout << i << " "; } in C++?

Question 22 of 40
★ FPSC ★ PPSC

What is the output of the following code: int x = 5; switch (x) { case 1: cout << "One"; break; case 5: cout << "Five"; break; } in C++?

Question 23 of 40
★ FPSC ★ PPSC

What is the syntax for the 'for' loop in C++?

Question 24 of 40
★ FPSC ★ PPSC

What does the 'do' keyword represent in the 'do-while' loop syntax in C++?

Question 25 of 40
★ FPSC ★ PPSC

What is the syntax for the 'if' statement with multiple conditions in C++?

Question 26 of 40
★ FPSC ★ PPSC

What will be the output of the following code: int x = 5; x > 2 ? cout << "Yes" : cout << "No"; in C++?

Question 27 of 40
★ FPSC ★ PPSC

In C++, what is the purpose of the 'do-while' loop?

Question 28 of 40
★ FPSC ★ PPSC

What will be the output of the following code: for (int i = 0; i < 5; ++i) { if (i == 3) continue; cout << i << " "; } in C++?

Question 29 of 40
★ FPSC ★ PPSC

What is the syntax for the 'else if' statement in C++?

Question 30 of 40
★ FPSC ★ PPSC

What does the 'default' case represent in a 'switch' statement in C++?

Question 31 of 40
★ FPSC ★ PPSC

What is the correct syntax for the 'do-while' loop in C++?

Question 32 of 40
★ FPSC ★ PPSC

What is the syntax for the 'switch' statement in C++?

Question 33 of 40
★ FPSC ★ PPSC

In C++, what is the purpose of the 'if-else' statement?

Question 34 of 40
★ FPSC ★ PPSC

What will be the output of the following code: int i = 5; if (i != 5) cout << "Not equal"; else cout << "Equal"; in C++?

Question 35 of 40
★ FPSC ★ PPSC

What is the purpose of the 'if' statement in C++?

Question 36 of 40
★ FPSC ★ PPSC

What is the output of the following code: int i = 0; do { cout << i << " "; i++; } while (i < 3); in C++?

Question 37 of 40
★ FPSC ★ PPSC

What does the 'continue' statement do in a loop in C++?

Question 38 of 40
★ FPSC ★ PPSC

What is the output of the following code: for (int i = 0; i < 5; ++i) { if (i == 3) continue; cout << i << " "; } in C++?

Question 39 of 40
★ FPSC ★ PPSC

What will be the output of the following code: for (int i = 0; i < 3; ++i) { for (int j = 0; j < 2; ++j) { cout << i << j << " "; } } in C++?

Question 40 of 40
★ FPSC ★ PPSC

In C++, what is the syntax for the 'while' loop?

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