Examveda

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");
}

A. 6 2
b

B. 8 1
a

C. 6 1
a

D. 8 1
b

Answer: Option B


Join The Discussion

Related Questions on Operators and Expressions in C Sharp