Reading a value from an array element
Reading an element: Name[index] in OUTPUT or an expression gives the value stored in that element. Reading only uses the value, so the element stays unchanged.
Understanding Reading a value from an array element in IGCSE Computer Science Paper 2
What it does: Scores[3] is read and its value is copied into Best, so Best now holds the same value as element 3. Name[index] in OUTPUT gives the value stored in that element, so 70 is displayed, not the text Marks[3]. The values in the elements are added: 40 + 55 = 95. The index numbers 1 and 2 are not added. The calculation goes on the right of the arrow. The variable that receives the answer goes on the left.
Common mistakes: Quotes make OUTPUT print the word Total instead of the value stored in the variable. It should be OUTPUT Total, which displays 95. An element is read using square brackets around the index, not round brackets. It should be OUTPUT StudentNames[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 449–458) 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
OUTPUT StudentNames[1]Fill in the Blanks
Spot the Error
Student with a class code? Join your class →