[Solved] Why the value plus plus at last is 100? [duplicate]


Because when you have the assignment operator, the right-hand operand is evaluated first, then that value is assigned to the receiver on the left.¹

So here’s what happens in value = value++:

  1. Read the value of value (100) and set it aside (since we’ll need it in a minute).
  2. Increase the value of value by one (making it 101).
  3. Take the value from #1 (100) as the result value of the right-hand operand.
  4. Store that value in value.

¹ In specification terms it’s slightly more complicated than that, but the details aren’t important here.

2

solved Why the value plus plus at last is 100? [duplicate]