Q. What is the output of the following C++ code?
int x = 10;
cout << ++x;
int x = 10;
cout << ++x;
β
Correct Answer: (C)
11
Explanation: '++x' is a pre-increment, so the value of 'x' is incremented first and then printed, resulting in 11.