English

Give the Output of the Following String Functions: (I) "Mississippi".Indexof('S') + "Mississippi".Lastindexof('I') (Ii) "Cable".Compareto("Cadet")

Advertisements

Question

Give the output of the following string functions:

  1. "MISSISSIPPI".indexOf('S') + "MISSISSIPPI".lastIndexOf('I')
  2. "CABLE".compareTo("CADET") 
Short Answer
Short/Brief Note
Advertisements

Solution

  1. 2 + 10 = 12
  2. −2 
shaalaa.com
  Is there an error in this question or solution?
Chapter 4: String Handling - Review Insight [Page 285]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 4 String Handling
Review Insight | Q 15. | Page 285
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×