Squareroot (Math.Sqrt(a))

The Squareroot function

what does the squareroot function do? The Math.Sqrt() function takes a number variable, a, and Calculates the square root of the number.

how do we use the Math.Sqrt() function? The method for using the function is: Math.Sqrt(a); "Math" is the library the function is a part of. "a" refers to the variable needed to run the function.

Example: float x = Math.Sqrt(25); this line would declare the variable "x" and give it the value 5.

Last updated

Was this helpful?