+ 1

How can I use sqrt function?

//My code #include <iostream> #include <math> using namespace std; int main () { float a; a=sqrt(25); cout<<a; return 0; } Output : math : no such file or directory

2nd Jan 2021, 11:37 AM
حازم الباز
حازم الباز - avatar
4 Antworten
+ 4
The name of header file is not 'math', it is 'cmath'. Change 'math' to 'cmath' in the 2nd lime #include <cmath>
2nd Jan 2021, 11:45 AM
XXX
XXX - avatar
+ 4
sqrt function in C++ returns the square root of the double integer inside the parameter list. The method accept a double integer value as input find square root and returns a double integer as output.
2nd Jan 2021, 11:39 AM
D_Stark
D_Stark - avatar
0
XXX You are ✅
2nd Jan 2021, 11:46 AM
حازم الباز
حازم الباز - avatar