Deep Dive: Loop Examples

Part of Iteration (Loops) ยท Section 4 of 8

Study NotesUnit: 3.2 ProgrammingGCSE

FOR loop (count-controlled):

for i = 1 to 5
    print(i)
next i
// Output: 1 2 3 4 5

WHILE loop (condition-controlled):

password = ""
while password != "secret"
    password = input("Enter password")
endwhile

DO-WHILE loop (runs at least once):

do
    choice = input("Enter 1, 2, or 3")
until choice >= 1 AND choice <= 3

This study notes covers Deep Dive: Loop Examples within Iteration (Loops) for GCSE Computer Science. Revise Iteration (Loops) in 3.2 Programming for GCSE Computer Science with 15 exam-style questions and 8 flashcards. This topic shows up very often in GCSE exams, so students should be able to explain it clearly, not just recognise the term. It is section 4 of 8 in this topic. Use this study notes to connect the idea to the wider topic before moving on to questions and flashcards.

Practice questions for Iteration (Loops)

Which type of loop is best used when you know exactly how many times the loop should repeat?

  • A. WHILE loop
  • B. FOR loop
  • C. REPEAT-UNTIL loop
  • D. IF statement
1 markfoundation

Explain what an infinite loop is, state one cause of an infinite loop, and describe one consequence of running an infinite loop in a program.

3 marksstandard

Quick recall flashcards

When use a FOR loop?
When you know how many times to repeat
What is iteration?
Repeating a set of instructions

15 questions on Iteration (Loops): practise free

Instant marking, adaptive difficulty and spaced-repetition flashcards โ€” all aligned to your exam board.

Start revising free โ†’