Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x != y ? x : y);
β
Correct Answer: (A)
10
Explanation: The ternary operator returns x if x is not equal to y, which is 10.