Multiple choice technology mainframe

If an IF statement is true, what’s the first thing it does?

  1. Exits the statement

  2. Executes the function

  3. Exits the Program

  4. Executes the If statement again

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When an IF condition evaluates to true, the first action is executing the code or function within the IF block. Only after execution does flow continue to any ELSE or statement exit. It doesn't exit immediately, exit the program, or re-execute.

AI explanation

When an IF condition evaluates to true, the first thing that happens is that the associated statement block (the 'then' branch/function body) is executed — that's the entire point of the conditional. 'Exits the statement' and 'exits the program' don't make sense as an immediate response to a true condition; those would only happen if the block itself contained an exit/return. 'Executes the if statement again' describes looping behavior, not what a single conditional does. So 'executes the function' (i.e., runs the code inside the true-branch) is the only answer describing standard if-statement semantics.