V

Vijay Sangwan • 28.62K Points
Instructor II

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
  • Correct Answer - Option(B)
  • Views: 21
  • Filed under category C++

Explanation by: Vijay Sangwan
The logical OR operator (||) returns true (1) if at least one of the operands is non-zero.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics