How to calculate cube root and square root of a number?
To calculate the cube root and the square root of a
double value we can use the
Math.cbrt(double a) and
Math.sqrt(double a) static method call.
This snippet will print the following output:
Cube root of 125.0 is 5.0
Square root of 100.0 is 10.0