Reading a value from a 2D array element
Gives the value stored at that row and column of a 2D array. Use it in an expression or OUTPUT, e.g. OUTPUT NoughtsAndCrosses[2,3] shows the value at row 2, column 3.
Understanding Reading a value from a 2D array element in IGCSE Computer Science Paper 2
What it does: Each Name[row, column] gives a value in the expression, so the two stored values can be compared with an operator such as >. The first index picks the row (the student) and the second picks the column (the subject), so this displays the Maths mark of the third student. Score ← Marks[3,1] copies the value from the array into Score. Putting the array element on the left would write into the array instead of reading from it. A 2D array needs two indexes, a row and a column, every time you read an element. A single index is not enough.
Common mistakes: Array indexes use square brackets, not round ones. It should be OUTPUT Board[2,3]. The row comes first and the column second. Row 3, column 2 is Marks[3,2], not Marks[2,3].
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 469–478) 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
Name[row, column]Fill in the Blanks
Spot the Error
Student with a class code? Join your class →