Question Detail

COM 101 COM 101 Past Questions Objective Question

Question

9. In the code snippet below, what does the statement STEP -1 means For index = 10 to 9 STEP -1
Options
A Increase the value of the index by 1
B Divide the value of the index by 1
C Nothing as for loops in VB cannot count backward
D Reduce the value of the index by 1
Correct Answer
Correct Answer

Option D is the correct answer.

Detailed Explanation

STEP -1 decrements the loop counter by 1 each iteration, allowing backward counting.

Hint

Negative step counts down.

Question Info