OCR GCSE Computer Science Paper 2 Practice 2025 - Free Practice Questions and Study Guide

Question: 1 / 400

What is a type of count-controlled iteration statement in programming?

While loop

If statement

FOR loop

A count-controlled iteration statement is designed to repeat a set of commands a specific number of times, based on a predefined count or limit.

The FOR loop is an excellent example of this because it allows the programmer to specify the starting point, the condition for continuation (such as a maximum count), and the increment or step that indicates how much the counter should change with each iteration. This structured approach makes it very clear how many times the loop will execute and what the bounds of that execution will be.

In contrast, a while loop continues to execute as long as a given condition remains true, but it doesn't inherently specify a fixed number of iterations, which means it can lead to indefinite loops if not managed carefully. An if statement functions as a conditional branching mechanism, executing code based on whether a specific condition is met and not controlling repetition at all. Finally, a switch case statement is used to handle multiple potential execution branches based on a variable’s value rather than for repeated execution.

Thus, the FOR loop is the definitive choice for a count-controlled iteration statement due to its clear structure aimed at iterating a specified number of times.

Get further explanation with Examzify DeepDiveBeta

Switch case

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy