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