Q1. In C, what does the following print? int x = 5; printf("%d", x++); printf("%d", ++x);
- A.5 6
- B.5 7✓ Correct
- C.6 7
- D.6 6
Explanation
x++ is post-increment: it uses the current value (5) then increments to 6. ++x is pre-increment: it increments first (to 7) then uses that value. So the output is '5' followed by '7'. Any language with both operators will behave this way for primitive integers.