10.9k views
3 votes
Given the statement: int list[25]; The index can go from 0 to 25 inclusive withoutgoing beyond the end of the array.true or false?

User Andy Joyce
by
6.4k points

1 Answer

4 votes

Answer:

False.

Step-by-step explanation:

When we create an array of size n, then it's index will starts from 0 to n-1. Array index starts with 0 because the first element of the array holds the memory location that refers to 0 element away.Similarly 2nd element of array is 1 distance away from that location. That is why index starts with 0 and goes to n-1 if the size is n.

In the question question, int list[25] is given. So the index will be from 0

to 25-1 only.If index will goes to 25 then it will go beyond the array.

User Kurt Ludikovsky
by
6.7k points