Skip to main content

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

Practice high-yield Programming & Software Development MCQs on Control Flow Statements In C Sharp — 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

Which control flow statement is used to iterate over a collection in C#?

Question 2 of 40
★ FPSC ★ PPSC

What is the result of the expression 5 > 3 ? "Yes" : "No" in C#?

Question 3 of 40
★ FPSC ★ PPSC

Which control flow statement is used to handle exceptions in C#?

Question 4 of 40
★ FPSC ★ PPSC

In C#, what is the syntax for a 'for' loop?

Question 5 of 40
★ FPSC ★ PPSC

Which keyword is used to skip the current iteration of a loop in C#?

Question 6 of 40
★ FPSC ★ PPSC

What is the result of the expression 10 % 2 == 0 ? "Even" : "Odd" in C#?

Question 7 of 40
★ FPSC ★ PPSC

Which control flow statement is used to define a block of code that executes repeatedly as long as a condition is true in C#?

Question 8 of 40
★ FPSC ★ PPSC

Which control flow statement is used to repeatedly execute a block of code as long as a specified condition is true in C#?

Question 9 of 40
★ FPSC ★ PPSC

Which loop in C# executes its body at least once, even if the condition is false?

Question 10 of 40
★ FPSC ★ PPSC

What is the result of the expression 7 % 4 in C#?

Question 11 of 40
★ FPSC ★ PPSC

Which of the following is a valid way to exit a loop prematurely in C#?

Question 12 of 40
★ FPSC ★ PPSC

What is the purpose of the 'do-while' loop in C#?

Question 13 of 40
★ FPSC ★ PPSC

In C#, what is the syntax for a 'switch' statement?

Question 14 of 40
★ FPSC ★ PPSC

Which of the following is used to control the flow of a program in C#?

Question 15 of 40
★ FPSC ★ PPSC

What does the 'default' keyword do in a 'switch' statement in C#?

Question 16 of 40
★ FPSC ★ PPSC

In C#, what is the syntax for a 'for-each' loop?

Question 17 of 40
★ FPSC ★ PPSC

What is the result of the expression 10 == 10 in C#?

Question 18 of 40
★ FPSC ★ PPSC

Which loop in C# is more appropriate for iterating through an array?

Question 19 of 40
★ FPSC ★ PPSC

In C#, what is the result of the expression 5 >= 5?

Question 20 of 40
★ FPSC ★ PPSC

Which control flow statement in C# is used to handle multiple conditions using a single switch expression?

Question 21 of 40
★ FPSC ★ PPSC

What is the result of the expression 12 < 5 ? "Yes" : "No" in C#?

Question 22 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int x = 0; do { x++; if (x == 5) { x++; continue; break; } Console.WriteLine(x + " "); } }while (x < 10);

Question 23 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int x; for (x = 10; x <= 15; x++) while (Convert.ToBoolean(Convert.ToInt32(x))) { do { Console.WriteLine(1); if (Convert.ToBoolean(x >> 1)) continue; }while (Convert.ToBoolean(0)); break; } Console.ReadLine(); }

Question 24 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int x; for (x = 1; x <= 3; x++) { int j = 1; do { j++; }while (x % j == 2); Console.WriteLine(x + " " + j); } Console.ReadLine(); }

Question 25 of 40
★ FPSC ★ PPSC

Which of the following conditions are true in the following C# code? static void Main(string[] args) { Console.WriteLine("Enter a letter:"); char c = (char)Console.Read(); if (Char.IsDigit(c) == true) Console.WriteLine("A number"); else if (char.IsLower(c) == true) Console.WriteLine("A lowercase letter"); else if (char.IsUpper(c) == true) Console.WriteLine("An uppercase letter"); Console.ReadLine(); } a. Enter a letter : a An uppercase letter b. Enter a letter : A An uppercase letter c. Enter a letter : 2 A number d. Enter a letter : 2 A lowercase letter.

Question 26 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { char ch = 'p'; switch (ch) { case 'p': Console.WriteLine("coco" + "\t" + Convert.ToInt32(ch)); break; default: Console.WriteLine("default"); break; } Console.WriteLine("main"); }

Question 27 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i; int b = 8, a = 32; for (i = 0; i <= 10; i++) { if ((a / b * 2)== 2) { Console.WriteLine( i + " "); continue; } else if (i != 4) Console.Write(i + " "); else break; } Console.ReadLine(); }

Question 28 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i; int j = 1; int []ar = {21, 22, 13, 4}; switch (ar[j]) { case 1: i++; break; case 2: i += 2; j = 3; continue; case 3: i %= 2; j = 4; continue; default: --i; } Console.WriteLine(i); Console.ReadLine(); }

Question 29 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i; for (i =-3; i <= 3; i++) { switch (i) { case 0: Console.WriteLine("zero"); break; } if (i > 0) Console.WriteLine("A"); else if (i < 0) Console.WriteLine("B"); } Console.ReadLine(); }

Question 30 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i = 0; int j = 0; for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { if (i > 1) continue; Console.WriteLine("Hi \n"); } } Console.ReadLine(); }

Question 31 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int temp = 1; switch (temp << 2 + temp) { default: Console.WriteLine("Example1"); break; case 4: Console.WriteLine("Example2"); break; case 5: Console.WriteLine("Example3"); break; case 8: Console.WriteLine("Example4"); break; } Console.ReadLine(); }

Question 32 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i = 9 , j = 7; switch (i - j + 3) { case 9: 7: j += 6; break; case 5: i -= 4; break; } Console.WriteLine(i + "\n" + j); Console.ReadLine(); }

Question 33 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i = 2, j = 4; switch (i + j * 2) { case 1 : case 2 : Console.WriteLine("1 and 2"); break; case 3 to 10: Console.WriteLine("3 to 10"); break; } Console.ReadLine(); }

Question 34 of 40
★ FPSC ★ PPSC

For the incomplete C# program below, which of the C# code fragment will not result in an infinite loop? static void Main(string[] args) { int i = 1234 ,j = 0; /*ADD CODE HERE */ Console.WriteLine(j); }

Question 35 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int x = 0; while (x < 20) { while (x < 10) { if (x % 2 == 0) { Console.WriteLine(x); } x++; } } Console.ReadLine(); }

Question 36 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { float i = 1.0f, j = 0.05f; do { Console.WriteLine(i++ - ++j); }while (i < 2.0f && j <= 2.0f); Console.ReadLine(); }

Question 37 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { Console.WriteLine("HI"); continue; Console.WriteLine("Hello"); Console.ReadLine(); }

Question 38 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int i = 0, j = 0; l1: while (i < 2) { i++; while (j < 3) { Console.WriteLine("loop\n"); goto l1; } } Console.ReadLine(); }

Question 39 of 40
★ FPSC ★ PPSC

What will be the output of the following C# code? { int i; Console.WriteLine("Hi"); for (i = 1; i <= 10; i++) Program.Main(args); Console.ReadLine(); }

Question 40 of 40
★ FPSC ★ PPSC

Which statement is correct among the mentioned statements? i. The for loop works faster than a while loop ii. for( ; ; )implements an infinite 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 →