Which loop repeats while the condition remains true?

Prepare for the IGCSE Algorithms and Pseudocode Exam. Study with comprehensive questions covering key algorithms and pseudocode techniques. Access hints and explanations to gear up for your exam success!

Multiple Choice

Which loop repeats while the condition remains true?

Explanation:
Loops continue based on a condition, and the way that condition is checked determines the type. A while loop checks the condition before each iteration, so it keeps repeating as long as that condition stays true. If the condition becomes false, the loop stops. This matches the idea of repeating while the condition remains true. In contrast, a repeat-until loop runs the body first and then checks the condition, so it keeps looping until the condition becomes true; it doesn’t repeat strictly while the condition is true. A for loop runs a predetermined number of times or over a fixed set of items, not based on a condition that might change during execution. An output command is not a looping structure.

Loops continue based on a condition, and the way that condition is checked determines the type. A while loop checks the condition before each iteration, so it keeps repeating as long as that condition stays true. If the condition becomes false, the loop stops. This matches the idea of repeating while the condition remains true.

In contrast, a repeat-until loop runs the body first and then checks the condition, so it keeps looping until the condition becomes true; it doesn’t repeat strictly while the condition is true. A for loop runs a predetermined number of times or over a fixed set of items, not based on a condition that might change during execution. An output command is not a looping structure.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy