Q. What is the output of the following code snippet? int x = 5; int y = x++; cout << y;
β
Correct Answer: (A)
5
Explanation: The post-increment operator (x++) assigns the original value of x to y before incrementing x.