Give the output of the following
double x=8.7, y=4.5;
System.out.println(Math.min(Math.floor(x),y));
Answers
Answered by
2
Answered by
1
Required Answer:-
Given Cσde:
To Find:
- Output (Java).
Output:
- 4.5
Explanation:
- Math.floor() function returns the lower integer for the given argument.
- So, Math.floor(x) = Math.floor(8.7) = 8.0
- Now, Math.min() function returns the minimum value of two numbers. Minimum of 8.0 and 4.5 is 4.5. Thus, the output is 4.5.
•••♪
Similar questions