Advertisements
Advertisements
प्रश्न
A single dimensional array has N elements in it. What is the last subscript?
विकल्प
N
N+1
0
N−1
MCQ
Advertisements
उत्तर
N−1
Explanation:
- In computer programming languages like Java, C, and C++, arrays use a zero-based indexing system, meaning the very first element is stored at index 0.
- Because counting begins at 0 instead of 1, the index position shifts down by one digit, making the final element of an array with N elements always sit at index N−1.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
