Skip to main content

Operators And Expressions In C Sharp — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Operators And Expressions In C Sharp — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

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

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

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

Correct order of priorities are:

Question 2 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a = 4; int b = 5; int c = 6; int d = 8; if (((a * b / c) + d) >= ((b * c + d ) / a)) { Console.WriteLine("Line 1 - a is greater to b"); Console.WriteLine((a * b / c) + d); } else { Console.WriteLine("Line 1 - a is not greater to b"); Console.WriteLine((b * c + d )/ a); } }

Question 3 of 29
★ FPSC ★ PPSC

Which among the following is a conditional operator?

Question 4 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { byte varA = 10; byte varB = 20; long result = varA & varB; Console.WriteLine("{0} AND {1} Result :{2}", varA, varB, result); varA = 10; varB = 10; result = varA & varB; Console.WriteLine("{0} AND {1} Result : {2}", varA, varB, result); Console.ReadLine(); }

Question 5 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? m = 5; int y; 1. y = m++; 2. y = ++m;

Question 6 of 29
★ FPSC ★ PPSC

Select the relevant C# code set to fill up the blank for the following C# program? static void Main(string[] args) { int x = 10, y = 20; int res; /*_______________*/ Console.WriteLine(res); }

Question 7 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int m = 10, n = 5, p = 20; bool b1 = m * p / n <= p * n / m ; int l = p - 2 * m; bool b2 = l == 0; int z = Convert.ToInt32(b2); int k = Convert.ToInt32(b1); Console.WriteLine(k); Console.WriteLine(z); }

Question 8 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int y = 5; int x; int k = (!(Convert.ToInt32(y) > 10))? x = y + 3 : x = y + 10; Console.WriteLine(x); Console.WriteLine(y); Console.ReadLine(); }

Question 9 of 29
★ FPSC ★ PPSC

Which of the following options is not a Bitwise Operator in C#?

Question 10 of 29
★ FPSC ★ PPSC

Arrange the operators in the increasing order as defined in C#. !=, ?:, &, ++, &&

Question 11 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? public static void Main() { byte varA = 10; byte varB = 20; long result = varA | varB; Console.WriteLine("{0} OR {1} Result :{2}", varA, varB, result); varA = 10; varB = 10; result = varA | varB; Console.WriteLine("{0} OR {1} Result : {2}", varA, varB, result); }

Question 12 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a, b, c, x; a = 90; b = 15; c = 3; x = a - b / 3 + c * 2 - 1; Console.WriteLine(x); Console.ReadLine(); }

Question 13 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { float a = 16.4f; int b = 12; float c; c = a * ( b + a) / (a - b) ; Console.WriteLine("result is :" +c); Console.ReadLine(); }

Question 14 of 29
★ FPSC ★ PPSC

Check the following C# code whether the given relation operator works according to the if condition or not. static void Main(string[] args) { int a = 10; int b = 5; int c = 12; int e = 8; int d; d = Convert.ToInt32((a * (c - b) / e + (b + c)) <= (e * (c + a) / (b + c) + a)); Console.WriteLine(d); if (d == 1) { Console.WriteLine("C# is great language!"); Console.WriteLine((a * (c - b) / e + (b + c))); } else { Console.WriteLine("harsh is not great language!"); Console.WriteLine((e * (c + a) / (b + c) + a)); } }

Question 15 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? public static void Main(string[] args) { int a = 4; int c = 2; bool b = (a % c == 0 ? true : false); Console.WriteLine(b.ToString()); if (a/c == 2) { Console.WriteLine("true"); } else { Console.WriteLine("false"); } Console.ReadLine(); }

Question 16 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a = 3, b = 5, c = 1; int z = ++b; int y = ++c; b = Convert.ToInt32((Convert.ToBoolean(z)) && (Convert.ToBoolean(y)) || Convert.ToBoolean(Convert.ToInt32(!(++a == b)))); a = Convert.ToInt32(Convert.ToBoolean(c) || Convert.ToBoolean(a--)); Console.WriteLine(++a); Console.WriteLine(++b); Console.WriteLine(c); }

Question 17 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a = 8, b = 6, c = 10; int d = a * c * 2 / Convert.ToInt32(Math.Pow ((c - b), 2)); if (d == (c = Convert.ToInt32(Math.Sqrt (a * a + b * b))) && c == 10) { Console.WriteLine("figure is hypotenuse"); } else { Console.WriteLine("figure is square"); } }

Question 18 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int n = 5; int x = 4; int z, c, k; for (c = 1; c <= n; c++) { for (k = 1; k <= c; k++) { z = 3 * x * x + 2 * x + 4 / x + 8; Console.Write(Convert.ToString(Convert.ToChar(z))); } Console.WriteLine("\n"); } Console.ReadLine(); }

Question 19 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? int n = 2; int p = 4; int q = 5; int w = 3; if ( !((p * q) /n <= (q * w) + n/p )) { Console.WriteLine( ++p + w++ + " " + ++n); Console.WriteLine("b"); } else { Console.WriteLine(--p + q-- + " " + --n); Console.WriteLine("a"); }

Question 20 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? bool a = true; bool b = false; a |= b; Console.WriteLine(a); Console.ReadLine();

Question 21 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a = 4, b = 5, c = 7, u = 9; int h; h = (Convert.ToInt32(u < b)) + (a + b--) + 2; Console.WriteLine(h); Console.WriteLine(b); Console.WriteLine(u < b); }

Question 22 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a , b; int c = 10; int d = 12; int e = 5; int f = 6; a = c * (d + e) / f + d; Console.WriteLine(a); b = c * ( d + e / f + d); Console.WriteLine(b); if (a < b) { Console.WriteLine(" parentheses changes values"); } else if (a > b) { Counterintelligence("they have same value"); } Console.ReadLine(); }

Question 23 of 29
★ FPSC ★ PPSC

Which of the following is/are not Relational operators in C#.NET?

Question 24 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int a, b, c, x; a = 80; b = 15; c = 2; x = a - b / (3 * c) * ( a + c); Console.WriteLine(x); Console.ReadLine(); }

Question 25 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { byte b1 = 0 * AB; byte b2 = 0 * 99; byte temp; temp = (byte) ~b2; Console.Write( temp + " "); temp = (byte) (b1 << b2); Console.Write(temp + " "); temp = (byte)(b2 >> 2); Console.WriteLine(temp); Console.ReadLine(); }

Question 26 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? static void Main(string[] args) { int n = 5; int x = 4; int z, c, k; z = 3 * x * x + 2 * x + 4 / x + 8; for (c = 1; c <= n; c++) { for (k = 1; k <= c; k++) { Console.Write(Convert.ToString(Convert.ToChar(z))); z++; } Console.WriteLine("\n"); } Console.ReadLine(); }

Question 27 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? int i, j = 1, k; for (i = 0; i < 3; i++) { k = j++ - ++j; Console.Write(k + " "); }

Question 28 of 29
★ FPSC ★ PPSC

The correct way of incrementing the operators are:

Question 29 of 29
★ FPSC ★ PPSC

What will be the output of the following C# code? class method1 { public int fun(int m) { return( m++ % 10); } } class Program { static void Main(string[] args) { int a = 23, b = 0, c; method1 z = new method1(); c = z.fun (++b * --a % 2); int d = (z.fun (c-- + --a)); Console.WriteLine(c); Console.WriteLine(a++); Console.WriteLine(d); Console.ReadLine(); } }

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