Multiple choice general knowledge

What will be printed as the result of the operation below: main() { int x=20,y=35; x=y++ + x++; y= ++y + ++x; printf(“%d%dn”,x,y); }

  1. 57,94

  2. 56,55

  3. 47,59

  4. 56,92

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

x=y++ + x++: x = 35 + 20 = 55, then y becomes 36, x becomes 56. y= ++y + ++x: y increments to 37 first, x increments to 57 first, so y = 37 + 57 = 94. Final output: 57 94. Requires understanding pre and post increment.