English

Predict the output of the following: String n1 = "46", n2 = "64"; int total = Integer.parselnt(n1) + Integer.parselnt(n2); System.out.println("The sum of " + "46" + "and" + " 64" + "is" + total); - Computer Applications

Advertisements
Advertisements

Question

Predict the output of the following:

String n1 = "46", n2 = "64"; 
int total = Integer.parselnt(n1) + Integer.parselnt(n2); 
System.out.println("The sum of " + "46" + "and" + " 64" + "is" + total); 
One Line Answer

Solution

The sum of 46 and 64 is 110.

shaalaa.com
  Is there an error in this question or solution?
Chapter 4: String Handling - EXERCISES [Page 287]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 4 String Handling
EXERCISES | Q IV. 2. | Page 287
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×