19.06.2018, 06:25
What others are trying to say is that, index starts from 0. So if you make an array with size of [9](as in your case), it will go from 0 to 9 spaces more that is, 8. To make it go upto 9, declare the array of size 10.