lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 20
What is the output of the following code fragment?
int a = 1, b = a; Console.WriteLine($"{a--} => {a}");
A. 1 => 1
B. 1 => 0
C. 0 => 1
D. 0 => 0
Postfix decremented operation
The result of postfix decremented operation is the value of the operand before it has been decremented. The value is modified only after the expression is evaluated.
Links:
The Decrement Operator (--)