When a condition in an If...Then statements tests true:

  1. the next Else statement is activated.

  2. the next If statement is activated.

  3. the next Then statement is activated.

  4. the End If statement is activated.

  5. a condition can never test true.


Correct Option: C
Explanation:

To solve this question, the user needs to know the basic syntax of an If...Then statement and the flow of control in such a statement.

An If...Then statement is a control flow statement that executes a block of code if a specified condition is true. The basic syntax of an If...Then statement is:

If condition Then
    statement
End If

Now, let's go through each option and explain why it is right or wrong:

A. The next Else statement is activated: This option is incorrect. The Else statement is executed only when the condition in the If statement is false. If the condition is true, the code block following the Then statement is executed, and the Else statement is skipped.

B. The next If statement is activated: This option is incorrect. The flow of control does not jump to the next If statement. Instead, the code block following the Then statement is executed, and the program continues with the statement following the End If.

C. The next Then statement is activated: This option is incorrect. There is no "next Then" statement in an If...Then statement. The code block following the Then statement is executed if the condition is true.

D. The End If statement is activated: This option is incorrect. The End If statement marks the end of the If...Then statement. It is not executed when the condition is true.

E. A condition can never test true: This option is incorrect. A condition can test true if the values on either side of the comparison operator are equivalent. If the condition is true, the code block following the Then statement is executed.

Therefore, the correct answer is:

The Answer is: C. The code block following the Then statement is activated when the condition in an If...Then statement tests true.

Find more quizzes: