REPEAT…UNTIL loop (7d)
A loop that runs its lines first, then checks the UNTIL condition. It stops when the condition is TRUE, so the body always runs at least once.
Understanding REPEAT…UNTIL loop (7d) in IGCSE Computer Science Paper 2
What it does: Num > 10 is already TRUE at the start, but OUTPUT still runs once before the condition is checked. WHILE tests the condition at the top, so the body is skipped if it is FALSE straight away. REPEAT would always run once. REPEAT runs the lines first and only then checks the UNTIL condition, so the check comes at the end of each pass. UNTIL states when to STOP. You stop when the number is valid, so the condition describes a valid number. The other option describes an invalid number and would keep the loop going on valid input. Cambridge pseudocode has no ENDREPEAT. The closing line is UNTIL followed by the stopping condition.
Common mistakes: In Cambridge pseudocode, values are assigned with ←, not =. The line should be Num ← Num * 2. The = sign is used to compare values. Count is reset to 1 on every pass, so it can never count more than one. The line should be Count ← Count + 1 to add one each time the loop runs.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 265–274) and word search (Modules 254–274).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
REPEAT ... UNTIL conditionFill in the Blanks
Spot the Error
Student with a class code? Join your class →