Computer Applications

The output of the statement Math.ceil.(89.9) + Math.floor(90.5) is:

  1. 0.0
  2. 180
  3. 180.0
  4. 180.4

Java Math Lib Methods

1 Like

Answer

180.0

Reason

  • Math.ceil(89.9) returns the smallest integer greater than or equal to 89.9, which is 90.0.
  • Math.floor(90.5) returns the largest integer less than or equal to 90.5, which is 90.0.
  • Adding them: 90.0 + 90.0 = 180.0

So, the output is 180.0.

Answered By

1 Like


Related Questions