Declaring a 2D array: ARRAY[l1:u1, l2:u2]
Declares a 2D array called Grid. The first range is the rows, the second is the columns, split by a comma. All elements share one data type, here CHAR.
Understanding Declaring a 2D array: ARRAY[l1:u1, l2:u2] in IGCSE Computer Science Paper 2
What it does: The comma between 1:5 and 1:8 splits the first dimension range from the second dimension range. OF CHAR sets one data type for all nine elements, so none of them can hold a different type. A 2D declaration puts both ranges inside ONE pair of square brackets, split by a comma. Each dimension has its own range. The rows can start at 0 while the columns start at 1. Both ranges here cover 3 values. The declaration needs OF between the ranges and the data type, otherwise it is not valid pseudocode.
Common mistakes: A declaration needs a colon between the identifier and ARRAY. It should be DECLARE Grid : ARRAY[1:3, 1:3] OF CHAR, so the first line should be DECLARE Grid :. The first range is 1:3, so the row index can only be 1, 2 or 3. Row 4 is out of range. It should be Board[3, 3] ← 'O'.
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
DECLARE Grid : ARRAY[1:3, 1:3] OF CHARFill in the Blanks
Spot the Error
Student with a class code? Join your class →