English

Write the output of the codes given below. String s1 = "RISTORANT"; String s2 = “VENEZUELA"; char c1 = s2.charAt(s1.indexOf('T')); int n1 = s1.indexOf(s2.charAt(8));

Advertisements
Advertisements

Question

Write the output of the codes given below.

String s1 = "RISTORANT";    String s2 = “VENEZUELA";
char c1 = s2.charAt(s1.indexOf('T'));   int n1 = s1.indexOf(s2.charAt(8));
System.out.print(" c1 =" +c1+ " and n1 ="+n1);
Very Short Answer
Advertisements

Solution

c1 = E and n1 = 6

shaalaa.com
  Is there an error in this question or solution?
Chapter 10: String Handling - Exercises [Page 246]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 10 String Handling
Exercises | Q 3. (b) | Page 246
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×