ICSE Class 10 Computer Applications Question 39 of 46

String Handling — Question 3

Back to all questions
3
Question

Question 3

The index of a string ............... .

  1. ranges from 0 to the length -1 of the string
  2. ranges from 0 to the length of the string
  3. ranges from 1 to the length of the string
  4. ranges from 1 to the length -1 of the string
Answer

ranges from 0 to the length -1 of the string

Reason — The index of a string ranges from 0 to the length -1 of the string as a string is similar to a character array whose index starts from 0 to size - 1.