मराठी

Given that: String kr = "Albert Einstein"; int pr = kr.indexOf('e'); What will be the value of pr?

Advertisements
Advertisements

प्रश्न

Given that:

String kr = "Albert Einstein";

int pr = kr.indexOf('e');

What will be the value of pr?

पर्याय

  • 4

  • 3

  • 12

  • 13

MCQ
Advertisements

उत्तर

3

Explanation:

  • The string is Albert Einstein.
  • indexOf('e') returns the index of the first lowercase 'e'.
  • The first lowercase 'e' is in Albert at index 3 (counting starts from 0).
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 10: String Handling - Exercises [पृष्ठ २४५]

APPEARS IN

रूपा पंडित Computer Applications [English] Class 10 ICSE
पाठ 10 String Handling
Exercises | Q 1. (iii) | पृष्ठ २४५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×