1 Answer | Add Yours
In the C programming language, the square root functionality is included in a library. To use this function, you must include the following compiler directive at the top of your program:
Having done so, the square root functionality is invoked using the "sqrt" function. For example,
y = sqrt(x);
would compute the square root of the value stored in variable x and store the result in variable y.
If you wish to use this C language functionality in the C++ language, the compiler directive is a bit different:
and the usage is the same as above.
We’ve answered 318,989 questions. We can answer yours, too.Ask a question