Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x == y ? x : y);
β
Correct Answer: (B)
20
Explanation: The ternary operator returns the greater value between x and y, which is 20.