Two-dimensional array: rows and columns
A table of rows and columns held in one variable. Each element needs two indexes: the first is the row (across), the second is the column (down), e.g. Marks[2, 3].
Understanding Two-dimensional array: rows and columns in IGCSE Computer Science Paper 2
What it does: Grid[1, 3] means row 1 (the top row, across) and column 3 (the third column, down). The X is stored in that one square. Each student is a row (1:4) and each test is a column (1:3). The array holds whole-number marks, so the type is INTEGER. A grid needs two sets of bounds, one for the rows and one for the columns. ARRAY[1:3] is a 1D array and only has 3 elements. The first index is always the row and the second is always the column. So Marks[2, 3] is row 2, column 3. A row on its own only picks out a whole line of the table. You need the row and the column to find one single element.
Common mistakes: A 2D array element needs two indexes: the row and then the column. Board[3] gives only one. It should be Board[3, 1] ← "X". Array indexes go inside square brackets, not round brackets. The line should be Marks[2, 2] ← 91.
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
2D arrayFill in the Blanks
Spot the Error
Student with a class code? Join your class →