Examveda

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

A. -4 -3 -2

B. -6 -4 -1

C. -2 -2 -2

D. -4 -4 -4

Answer: Option C


Join The Discussion

Related Questions on Operators and Expressions in C Sharp