Current location - Training Enrollment Network - Mathematics courses - What is the square root function in C language?
What is the square root function in C language?
1 and the function of finding the square root in C language is sqrt.

2. Example:

Function prototype: double sqrt (double x); And float sqrt (float x);

Header file: # include

Parameter description: x is the numerical value for calculating the square root.

Return value: returns the square root of x.

Note: if x

Example calculates the square root value of 200:

# include & ltmath.h & gt

# include & ltstdio.h & gt

int main(){

Double root;

root = sqrt(200);

Printf ("The answer is %f\n", root);

Returns 0;

}

//Output: The answer is 14. 14 136.