हिंदी

If a string contains 12 characters, what will be the index of the last character? - Computer Applications

Advertisements
Advertisements

प्रश्न

If a string contains 12 characters, what will be the index of the last character?

विकल्प

  • 12

  • 11

  • 10

  • 0

MCQ

उत्तर

11

Explanation:

Most computer languages (Java, Python, and C++) use zero-indexed strings, meaning character indexing begins at 0. So, if a string has 12 characters, the index of the last character is 11 (since the first character is at index 0). 

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 4: String Handling - EXERCISES [पृष्ठ २८६]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 4 String Handling
EXERCISES | Q I. 3. | पृष्ठ २८६
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×