Iteration means repeating a block of statements instead of writing it out many times. This lesson covers the count-controlled FOR loop, the two condition-controlled loops WHILE and REPEAT, the crucial difference between them, and how loops can be nested inside one another.
1. How many times does the body of this loop run? FOR count <- 1 TO 5 OUTPUT count NEXT count
2. Which loop is guaranteed to execute its body at least once?
3. What value is output by this nested loop? total <- 0 FOR i <- 1 TO 3 FOR j <- 1 TO 2 total <- total + 1 NEXT j NEXT i OUTPUT total
4. A WHILE ... ENDWHILE loop is described as a pre-condition loop. What does this mean?
Practise real exam questions on this
Type your answer, see your mark against the mark scheme in seconds. Free, 5 a day.
Start practising →
Teaching this topic?
Mark your whole class's answers and see who's stuck, for £19 a month.
See the class plan →
Free revision content. Multiple-choice answers are marked instantly. Written answers are marked by AI on /free-mark.