Give the output of the following code statement.
[2]
double x = 2.9 , y = 2.5;
System.out.println
(Math.min(math floor (x), y ));
System.out.println (Math.max(math ceil (x), y ));
Answers
Answered by
3
Answer:-
Given code,
double x = 2.9 , y = 2.5;
System.out.println(Math.min(Math.floor (x), y ));
System.out.println (Math.max(Math.ceil (x), y ));
At first, we will evaluate the expression,
Math.min(Math.floor(x),y)
=Math.min(2.0,25)
=2.0
Math.max(Math.ceil(x),y)
=Math.max(3.0,2.5)
=3.0
Output:-
2.0
3.0
Similar questions