1
AssignmentMultiple Select

Variables and Data Types

Question 1 • Introduction to Information Technology - EL3701

Which statements describe an If statement? Check all that apply.

Answer
A
A conditional If statement is used when the programmer wants decision-making included in the code.
B
A conditional If statement executes code when the condition returns a value of false.
C
A conditional If statement executes a piece of code when one statement is false and the following statement is true.
D
A conditional If statement tests whether the condition following it is true or false before executing a specified part of the code.

Explanation

An If statement lets a program make decisions by checking a condition and choosing whether to run code. It tests whether the condition is true or false, then executes the specified code when the condition is true. So A and D describe an If statement; B is incorrect because an ordinary If statement does not run its code when its condition is false.

AI-written and checked against the verified answer.

Next