Multiple choice technology programming languages

void main() { int i=5; i+=i*=i-=i/i; printf("%d",i); }

  1. 5

  2. 25

  3. 20

  4. 32

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

This complex compound assignment evaluates right-to-left with operator precedence. i/=i equals 1 (integer division). Then i-=1 makes i=4. i*=4 makes i=16. Finally i+=16 makes i=32. The key is tracking each step carefully with operator precedence.