QuesAns Print Page – CSKC
Sign In

Search

siteicon
Q&A ICSE2017-03G #7244

Question:

What are the values stored in variables r1 and r2:
(i) double r1 = Math.abs(Math.min(-2.83, -5.83));
(ii) double r2 = Math.sqrt(Math.floor(16.3));

Answer:

(i) double r1 = Math.abs(Math.min(-2.83,-5.83));
= Math.abs(-5.83)
= 5.83
(ii) double r2 = Math.sqrt(Math.floor(16.3));
= Math.sqrt(16)
= 4.0