Detailed Print – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
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

		 

Click to open popup

Solved Problem Understanding

(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

Notes