Solved Problem Solved Problem#JAVA#7244
Problem Statement - Output based on Math functions
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));
Solution
(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