How to get square root of number in java

In this tutorial. we will see if how to get square root of number in java.
It is very simple to get square root of number in java. You can simply use Math’s sqrt() method to calculate square root of number.

Syntax

Return type

It returns square root of the number.

Square root of number

Let’s see sqrt method with the help of example.

Above program will generate below output.

Square root of 26:5.0990195135927845
Square root of 26:7.483314773547883
Square root of 26:9.1104335791443

That’s all about square root of number in java

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *