Exam-style question
Try this first
Which of the following correctly accesses the first element of a 1D array named 'arr'?.
- A.arr[0]
- B.arr[1]
- C.arr[2]
- D.arr[first]
Answer and explanation
Concise answer
arr[0]
Why this is correct
Array indexing starts at 0, so the first element is at index 0.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
