Looping with a lower bound of zero
For ARRAY[0:29], the loop must start at the lower bound 0 and end at the upper bound 29. It then visits all 30 elements and never goes outside the array.
Understanding Looping with a lower bound of zero in IGCSE Computer Science Paper 2
What it does: The array is declared with bounds 0 and 9, so the loop limits must be 0 and 9 to match the declaration. ARRAY[0:49] has a lower bound of 0 and an upper bound of 49, so the FOR loop uses exactly those two numbers. Indexes 0 to 29 inclusive give 30 elements (29 - 0 + 1 = 30). The loop visits each one once and never leaves the array.
Common mistakes: Mark has a lower bound of 0, so the loop must start at 0. Starting at 1 skips Mark[0]. The correct line is FOR I ← 0 TO 9. The array runs from index 0 to 29. A loop starting at 1 misses element 0. The correct line is FOR Index ← 0 TO 29.
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 459–468) and word search (Modules 459–478).
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 Index ← 0 TO 29Fill in the Blanks
Spot the Error
Student with a class code? Join your class →