Double-precision floating point (±1.7E±308, ~15 decimal digits)
1st Parameter
The input value for which the square root is to be calculated. Must be non-negative.
Read more about parameters of sqrt in parameters section
The sqrtfunction in C language Calculates the square root of the specified number.
The sqrt function computes the non-negative square root of x. A square root is the number y such that y^2 = x.
The sqrtfunction takes 1
parameter:
•
double `x`: The input value for which the square root is to be calculated. Must be non-negative.
Calculates the square root of the input `x`. Returns the result as a `double`. If `x` is negative, the function sets `errno` to `EDOM` and returns a domain error (often `NaN`).
The sqrt function return value :
Returns the non-negative square root of x
If x is negative, a domain error occurs and the function returns NaN
Output
This example calculates and prints the square root of 16.