What is the index of the first element in an array in C?
20242025
What is the index of the first element in an array in C?
- A.
0
- B.
1
- C.
-1
- D.
Undefined
Attempted by 1473 students.
Show answer & explanation
Correct answer: A
In C, array indexing starts from 0. That means the first element is accessed by array[0], the second by array[1], and so on. This is a fundamental concept in C programming, and different from some other languages like MATLAB where indexing starts from 1.