+ 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
4 Respostas
+ 4
The name of header file is not 'math', it is 'cmath'. Change 'math' to 'cmath' in the 2nd lime
#include <cmath>
+ 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.
0
XXX
You are ✅