Multiple choice general knowledge

Guess the Output? void main() { int i=5; i+=i*=i-=i/i; printf("%dn",i); }

  1. 1

  2. 4

  3. 5

  4. 29

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

The expression i+=i*=i-=i/i evaluates as: i/i = 1, i-=1 makes i=4, i*=4 makes i=16, i+=16 makes i=5 (using the original i=5 from the left side of += due to sequence point rules in C). This is a classic compound assignment trick question.