
Students' Guide to
Program
Design
5.2 Repetition using the REPEAT..UNTIL
structure
The REPEAT.UNTIL structure is similar to the DOWHILE structure, in
that a group of statements are repeated, in accordance with a specified
condition. However, where the DOWHILE structure tests the condition
at the beginning of the loop, a REPEAT..UNTIL structure tests the
condition at the end of the loop. This means that the statements within
the loop will be executed once, before the condition is tested. If the
condition is false, the statements will then be repeated UNTIL the
condition becomes true.
The format of the REPEAT..UNTIL structure is
REPEAT
statement ...