+ 4

Whats the function for finding the square root of a no.?

and what would be the header file that I should include with it?

22nd Aug 2018, 8:36 AM
riya
riya - avatar
7 Respuestas
+ 16
in sololearn use #include<cmath.h> as a header file but if u are using turbo c++then use #include<math.h>
22nd Aug 2018, 7:47 PM
Srikant
Srikant - avatar
+ 5
https://www.programiz.com/cpp-programming/library-function/cmath/sqrt Library: #include <cmath> Function: sqrt(num) ie: double x = 25; x = sqrt(x); 'x' is 5.0
22nd Aug 2018, 8:59 AM
Louie
Louie  - avatar
+ 4
sqrt()
22nd Aug 2018, 12:21 PM
Sonic
Sonic - avatar
+ 1
you can use sqrt()
22nd Aug 2018, 5:07 PM
Vimlesh Kumar
Vimlesh Kumar - avatar
+ 1
what is the use of namspace std in c++ program
22nd Aug 2018, 5:53 PM
Pranaw Kaushal
Pranaw Kaushal - avatar
+ 1
#include <iostream> #include <cmath> using namespace std; int main() { int num = 10; cout << "Square Root of " << num << " is: "<< sqrt(num) << endl; return 0; } Another student said this code doe no work. I ran this in SolLearn compiler without a problem. Notice to run math functions you must have this statement: #include <cmath>
28th Sep 2018, 12:25 PM
Lloyd L Conley
Lloyd L Conley - avatar
0
sqrt() function will be usefull
23rd Aug 2018, 8:28 AM
vamsikrishna.P
vamsikrishna.P - avatar