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

  • (A) 0
  • (B) 1
  • (C) 10
  • (D) 20
πŸ’¬ Discuss
βœ… Correct Answer: (B) 1
Explanation: The logical OR operator (||) returns true (1) if at least one of the operands is non-zero.
Explanation by: Vijay Sangwan
The logical OR operator (||) returns true (1) if at least one of the operands is non-zero.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
130
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vijay Sangwan
Publisher
πŸ“ˆ
85%
Success Rate