MCQ Practice Single Best Answer Topic: ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL

Q Give 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));

Question ID
#23876
Subchapter
ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A 26
  • B 74
  • C 100.0
  • D 2674
Correct Answer: 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

Share this MCQ with your friends or study group.