Multiple choice

Element 'myarray[4]' is which element of the array?

  1. Fourth

  2. Fifth

  3. Third

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Array elements are zero-indexed in C/C++ and most programming languages. Element myarray[4] is actually the fifth element because myarray[0] is the first, myarray[1] is the second, and so on. This zero-based indexing is a common source of off-by-one errors for beginners.