Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x && y);
β
Correct Answer: (B)
1
Explanation: The logical AND operator (&&) returns true (1) if both x and y are non-zero.