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

  • (A) 10
  • (B) 20
  • (C) 0
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10
Explanation: The ternary operator returns the smaller value between x and y, which is 10.
Explanation by: Ram Sharma
The ternary operator returns the smaller value between x and y, which is 10.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
154
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
82%
Success Rate