हिंदी

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×