Multiple choice .net

The For...Next Loop is used when:

  1. a choice is made based on a Boolean condition.

  2. a block of statements is executed an unknown number of times.

  3. a block of statements is executed a known number of times.

  4. Both a and b.

  5. All of the above.

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

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.

AI explanation

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.