STEP in a FOR loop
STEP sets how much the FOR counter changes each repeat. Without STEP the counter goes up by 1. A negative STEP, such as -1, makes the counter count down.
Understanding STEP in a FOR loop in IGCSE Computer Science Paper 2
What it does: With no STEP the default step is 1, so this loop gives the counter values 1, 2, 3, 4, 5. The values are 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100. That is 11 values, because 0 counts as the first repeat. A negative STEP subtracts from the counter each repeat, so the counter counts down. A positive STEP makes it count up. Count takes the values 10, 9, 8, 7, 6, 5, 4, 3, 2, 1. That is 10 values, and both the start and end values are included. The correct line is FOR Number <- 0 TO 100 STEP 10, with the number straight after the word STEP.
Common mistakes: A FOR loop in Cambridge pseudocode ends with NEXT followed by the counter name, not ENDFOR. Line 3 should be NEXT Count. Without STEP the counter goes up by 1, so it can never count down from 10 to 1 and the loop would not run. It needs STEP -1: FOR Num <- 10 TO 1 STEP -1.
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 369–378) and word search (Modules 358–378).
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
FOR Count <- 10 TO 1 STEP -1Fill in the Blanks
Spot the Error
Student with a class code? Join your class →