मराठी

A single dimensional array has N elements in it. What is the last subscript?

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 N1.
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 7: Arrays - One Dimension - Exercises [पृष्ठ १७२]

APPEARS IN

रूपा पंडित Computer Applications [English] Class 10 ICSE
पाठ 7 Arrays - One Dimension
Exercises | Q 1. (i) | पृष्ठ १७२
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×