What is the result of the expression 1 && 0 in C?
A. 1
B. 0
C. TRUE
D. FALSE
Answer: Option B
Solution(By Examveda Team)
In C, the && operator is the logical AND operator. It returns 1 (TRUE) if both operands are true (non-zero), and 0 (FALSE) if any of the operands is false (zero). In this expression, the second operand is 0, which is false. Therefore, the result of the expression is 0 (FALSE).Option A (1) is incorrect because the result of the expression is 0, not 1.
Option C (TRUE) represents the true value, but the result of the expression is 0 (FALSE).
Option D (FALSE) represents the false value, which is the correct result of the expression.
Related Questions on Operators and Expressions
What does the ++ operator do in C when applied to a variable?
A. Decrements by 1
B. Adds 1
C. Doubles the value
D. Leaves it unchanged
Join The Discussion