Multiple choice technology programming languages

Find the output of this program. main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

  1. -1

  2. 1

  3. 0

  4. Compiler error

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The while condition checks +(+i--)!=0. With i=0, i-- returns 0 then decrements i to -1. The condition 0!=0 is false, so the loop body never executes. However, i is now -1 due to the post-decrement. Option C incorrectly assumes the loop runs.