English

Write the output of the codes given below. String na = “9876543210"; String nb = "0123456789"; int nk1 = Integer.valueOf(String.valueOf(na.charAt(0))); int nk2 = Integer.valueOf(nb.substring(1, 3));

Advertisements
Advertisements

Question

Write the output of the codes given below.

String na = “9876543210"; String nb = "0123456789";
int nk1 = Integer.valueOf(String.valueOf(na.charAt(0)));
int nk2 = Integer.valueOf(nb.substring(1, 3));
int nk3 =nk1 * nk2;
System.out.println(" NK1 :: " + nk1);
System.out.println(" NK2 :: ” + nk2);
System.out.println(" NK3 :: " + nk3);
Very Short Answer
Advertisements

Solution

NK1 :: 9

NK2:: 12

NK3:: 108

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

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×