Computer Science, asked by ItzBrainlyQueen01, 12 days ago

Give the output of the following program segment :
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 kajalpal1975
3

Answer:

x = 2.9, y = 2.5

Math.min (Math.floor (x), y )

= Math.min (Math.floor (2.9), 2.5) )

= Math.min (2.0, 2.5)

= 2.0

Math.min (Math.ceil (x), y )

= Math.min (Math.ceil (2.9), 2.5) )

= Math.min (3.0, 2.5)

= 3.0

Similar questions