MCQ Single Best Answer Moderate

QGive the output of the following code:

String A = "26.0"; 
String B = "74.0";

double C = Double.parseDouble(A); 
double D = Double.parseDouble(B);

System.out.println((C + D));

ID: #23876 ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL 92 views
Question Info
#23876Q ID
ModerateDifficulty
ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOLTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 26
  • B 74
  • C 100.0
  • D 2674
Correct Answer: Option C

Explanation

Explanation:

  • Double.parseDouble() converts the string values "26.0" and "74.0" into double values.
  • Adding 26.0 and 74.0 results in 100.0.

Share This Question

Challenge a friend or share with your study group.