Computer Applications

A single dimensional array contains N elements. What will be the last subscript?

  1. N
  2. N - 1
  3. N - 2
  4. N + 1

Java Arrays

6 Likes

Answer

N - 1

Reason — The subscripts of an array range from 0 to size - 1. Thus, an array of size N will have the subscripts ranging from 0 to N - 1.

Answered By

2 Likes


Related Questions