हिंदी

Write the output of the codes given below. String sp = "HOCKEY 12 CRICKET 100 FOOTBALL 4"; int r1 = Integer.valueOf(sp.substring(7,9)) + sp.indexOf('K');

Advertisements
Advertisements

प्रश्न

Write the output of the codes given below.

String sp = "HOCKEY 12 CRICKET 100 FOOTBALL 4";
int r1 = Integer.valueOf(sp.substring(7,9)) + sp.indexOf('K');
System.out.println(" R1 = " + r1);
String sq = sp.replace('O', sp.charAt(4)); System.out.println(" SQ = " +sq);
int dif = sp.compareTo(sq); System.out.println(" DIF = " +dif);
अति संक्षिप्त उत्तर
Advertisements

उत्तर

R1 = 15

SQ = HECKEY 12 CRICKET 100 FEETBALL 4

DIF = 10

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

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 10 String Handling
Exercises | Q 3. (h) | पृष्ठ २४७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×