asked 128k views
0 votes
1. In a language with zero-based indexing, at what index will the 100th item in an array be?

2. Same as 1.1, but for a language with one-based indexing.

asked
User Cedd
by
7.3k points

1 Answer

7 votes

Answer:

Following are the answer to this question:

In question 1, The index value will be "99".

In question 2, The index value will be "100".

Step-by-step explanation:

In any programming language, the indexing of array always starts with the 0, and in the given question two points are defined, which can be explained as follows.

  • In point 1, It is declared that an array is defined that stores 100 elements, and its indexing is based on zero, that's why its 100th element index value is 100.
  • In point 2, At this point, it is defined, that its indexing starts from 1, then its 100th element indexing value is 100.
answered
User Eric Tjossem
by
7.6k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.