why index of arrays start from 0 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why index of arrays start from 0

28th Aug 2016, 6:16 AM
rohan arora
3 Answers
28th Aug 2016, 8:26 AM
WPimpong
WPimpong - avatar
0
Because.
28th Aug 2016, 6:32 AM
Hickacou
Hickacou - avatar
- 1
It makes looping them easier. You can simply use: for(int i =0; i < arr.length; i++) If it started from 1 you would had to use this for(int i=1; i < arr.length+1; i++)
29th Aug 2016, 8:59 AM
Miro Jäntti
Miro Jäntti - avatar