10
QuizMultiple Choice

Use Data Structures — Cumulative exam

Question 10 • Introduction to Information Technology - EL3701

An If statement is based on boolean logic because

Answer
A
the condition in the statement tests TRUE or FALSE.
B
it contains two different conditions.
C
it returns either a 0 or a 1.
D
it uses shorthand operators.

Explanation

An If statement checks whether its condition is TRUE or FALSE, then follows the appropriate path based on that result. That yes-or-no evaluation is the basis of Boolean logic. Choice A is correct; an If statement does not need two conditions, return 0 or 1, or use shorthand operators.

AI-written and checked against the verified answer.

Previous
Next