Computer Applications

What value will Math.sqrt(Math.ceil(15.3)) return?

  1. 16.0
  2. 16
  3. 4.0
  4. 5.0

Java Math Lib Methods

ICSE 2023

33 Likes

Answer

4.0

Reason — Math.ceil method returns the smallest double value that is greater than or equal to the argument and Math.sqrt method returns the square root of its argument as a double value. Thus the given expression is evaluated as follows:

Math.sqrt(Math.ceil (15.3))
= Math.sqrt(16.0)
= 4.0

Answered By

14 Likes


Related Questions