Computer science · Grades 6–9
Zero-based array indexing
An index of zero refers to the first position, not the second.
The key idea
An index of zero refers to the first position, not the second.
first item → index 0
Worked examples
Using zero-based indexing, what is values[3] for values = [29, 32, 60, 98, 68]?
index 3 → 98
98
Using zero-based indexing, what is values[0] for values = [68, 90, 22, 95, 91]?
index 0 → 68
68
Try it yourself
Using zero-based indexing, what is values[3] for values = [88, 19, 32, 29, 69]?
Using zero-based indexing, what is values[4] for values = [75, 36, 40, 3, 40]?
Check your understanding
Answers and marking notes
- 29
index 3 → 29
- 40
index 4 → 40
Learning preview · teacher review required. Grade bands are approximate, not official curriculum alignment.