Q. What is the output of the following code snippet? int a = 10; int b = 20; cout << (a > b ? a : b);

  • (A) 10
  • (B) 20
  • (C) 0
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 20
Explanation: The ternary operator returns the greater value between a and b, which is 20.
Explanation by: Priyanka Tomar
The ternary operator returns the greater value between a and b, which is 20.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
105
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Priyanka Tomar
Publisher
πŸ“ˆ
95%
Success Rate