If you have an array with 20 elements
int test[20];
Then (as you say) the indexes for those elements are 0  19 inclusive, and you will find that there are 20 numbers in that range.
 0, 1, 2, 3, 4,

5, 6, 7, 8, 9,

10, 11, 12, 13, 14

15, 16, 17, 18, 19

So the array has 20 entries and the index of it's top entry is 19.
If you get the number of elements in the array by using test.size() if it's a class or (sizeof test/sizeof test[0]) if it's a simple array then you will always be able to access the last element of the array using size  1.
This is true for any size array, an array of 1000 entries will have indexes numbered 0  999 inclusive, the last index = size  1.