Multiple choice technology programming languages

Which looping process is best used when the number of iterations is known?

  1. for

  2. while

  3. do-while

  4. all looping processes require that the iterations be known

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

The for loop is best used when the number of iterations is known because it explicitly initializes, tests, and increments a counter in a single statement. While and do-while loops are better for condition-based iteration where the count is unknown.