int x=10;
Console.WriteLine(x);
x=x++;
Console.WriteLine(x);
Value of x (10) is assigned to x, then the value of x is incremented which internally works as x=x+1
.
So effectively:
x=x
x=x+1
That is - x++ increments x after any operations done in the same line.
So when the value is printed why is it not showing 11? Where is the incremented value (step 2) that is assigned to x (implicitly) gone?