4
AssignmentMultiple Choice

Variables and Data Types

Question 4 • Introduction to Information Technology - EL3701

Which choice best describes an If statement?

Answer
A
a conditional statement that tests whether the condition following it is true or false, then executes the part of the code that corresponds with that result
B
a conditional statement that tells a program to do something only if the answer to the expression is true
C
a conditional statement that executes a piece of code when one statement is false
D
a conditional statement that executes a piece of code whenever an If appears

Explanation

An if statement checks a condition and runs its associated code only when that condition is true. Choice B describes this behavior. Choice A refers more broadly to a conditional structure with branches for both true and false results.

AI-written and checked against the verified answer.