🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Arrays and Strings: all 10 questions

Quiz: C Arrays and Strings · Question 9 of 10

For int a[10];, what is the index of the last element?

For int a[10];, what is the index of the last element?

  1. A.10
  2. B.9
  3. C.11
  4. D.-1
Answer & explanation

Correct answer: 9

Indexes run from 0 to 9; a[10] is outside the array and reading it is undefined behaviour.

Can you get the rest right without peeking?

Take the timed Quiz: C Arrays and Strings quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →