Q. What will be the output?
Code:
int x = 5; System.out.println(x++ + ++x);
β
Correct Answer: (B)
12
Explanation: x++ gives 5 then x becomes 6, ++x makes it 7, so 5 + 7 = 12.