The For...Next Loop is used when:
-
a choice is made based on a Boolean condition.
-
a block of statements is executed an unknown number of times.
-
a block of statements is executed a known number of times.
-
Both a and b.
-
All of the above.
The For...Next loop is specifically designed when you know exactly how many iterations are needed in advance. It uses a counter that increments automatically from a starting value to an ending value. This makes it ideal for processing arrays or executing code a predetermined number of times.
For...Next is a counted loop: you specify a start value, end value, and optional step, so it's used when the number of iterations is known in advance (e.g., "loop 10 times" or "for each index in an array"). A Boolean-condition choice describes an If statement, not a loop. An unknown number of repetitions describes a Do While/Do Until loop, which tests a condition rather than counting iterations. Since "known number of times" is the defining trait of `For...Next", the other combined options ("both"/"all of the above") are incorrect because they lump in the unrelated unknown-iteration case.