Q. What will be the output of the following code?
int a = 5;
cout << ++a;
int a = 5;
cout << ++a;
β
Correct Answer: (B)
6
Explanation: The '++a' is a pre-increment operator, which increments the value of 'a' before it is used, so the output is 6.