QUESTION IMAGE
Question
an expression tested by an if statement must evaluate to ______.
0 or 1
+1 or −1
true or false
t or f
In programming, an if statement evaluates a boolean expression. A boolean expression can only result in a boolean value, which is either true (representing a condition that is met) or false (representing a condition that is not met). The options "0 or 1" are often used in some contexts to represent boolean values (like in C where 0 is false and non - zero is true, but the if statement's test expression conceptually expects a boolean result), "+1 or - 1" are just regular integers and not the expected result type for an if statement's test, and "t or f" are not the standard boolean literals (the standard are true and false in most programming languages).
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
C. true or false