Question #6994
Submitted by Answiki
on 10/22/2022 at 06:33:39 PM UTC
In which library is the sqrt (square root) function in C?
Merged questions
Answer
Submitted by Answiki
on 10/22/2022 at 06:34:43 PM UTC
In C, the sqrt() function calculate the square root. This function is part of the math.h library.
#include <math.h>
Here is a full example:
#include <stdio.h>
#include <math.h>
int main()
{
double x = 25.;
// Display 5.000000
printf("%f", sqrt(x));
return 0;
}
Answer by Answiki on 10/22/2022 at 06:34:43 PM
In C, the sqrt() function calculate the square root. This function is part of the math.h library.
#include <math.h>
Here is a full example:
#include <stdio.h>
#include <math.h>
int main()
{
double x = 25.;
// Display 5.000000
printf("%f", sqrt(x));
return 0;
}
Question by Answiki 10/22/2022 at 06:33:39 PM
In which library is the sqrt (square root) function in C?
| # | ID | Query | URL | Count |
|---|---|---|---|---|
| 0 | 12156 | en | https://en.ans.wiki/6994/in-which-library-is-the-sqrt-square-root-function-in-c | 7 |
Icons proudly provided by Friconix.