Computer Applications

State the value and type of each expression.

Math.sqrt(Math.pow(2.7, 2))

Java Math Lib Methods

4 Likes

Answer

The output value is 2.7. The type of expression is double.

Explanation

Math.pow(2.7, 2) will calculate square of 2.7 as we are raising it to the power 2. After this, calculating square root with Math.sqrt() will return the same number 2.7. The return type of Math.sqrt() is double so the type of expression is double.

Answered By

1 Like


Related Questions