Lower bound and upper bound
In ARRAY[l:u], l is the lower bound (index of the first element) and u is the upper bound (index of the last). Here the lower bound is 1 and the upper bound is 30.
Understanding Lower bound and upper bound in IGCSE Computer Science Paper 2
What it does: In ARRAY[1:25] the 1 before the colon is the lower bound, so the first element is Marks[1]. The upper bound is the second number in l:u. It is the index of the last element, so here it is 30. The bounds are separated by a colon, written l:u. A hyphen is not used. The indexes are consecutive. They run from the lower bound to the upper bound with none missing: 1, 2, 3 ... 30.
Common mistakes: In ARRAY[1:30] the lower bound is the index of the first element, which is 1. It should be lower ← 1. The value 30 is the upper bound. The upper bound of ARRAY[1:7] is 7, so the last valid index is 7. Temp[8] is outside the bounds. It should be OUTPUT Temp[7].
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 439–448) and word search (Modules 439–458).
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
ARRAY[1:30]Fill in the Blanks
Spot the Error
Student with a class code? Join your class →