Iteration (Loops)

Computer ScienceOCRGCSEUnit: 3.2 Programming
Free taster
5 of 6 sections open
The basics

Repeating Actions

Repeating Actions

Iteration means repetition. Imagine writing "I will not be late" 100 times - boring! A loop does it for you. FOR loops repeat a set number of times (write it 100 times). WHILE loops repeat while a condition is true (keep writing until the teacher says stop). DO-WHILE always runs at least once before checking. Loops are the power tools of programming!

Now try it yourself

Quiz · Question 1 of 15

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

Tap an answer to check it

Revise every Computer Science topic, free during alpha

Iteration (Loops) is one of 60 topics on PrepWise — all aligned to your exam board.

Start revising free →