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 UTCIn 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 PMIn 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 |
---|

Icons proudly provided by Friconix.