0
How to make a squaroot in c++
I relly want to know how to do a squaroot.Can anyone tell me how? You can give me some advice but simple program is better þhan advice or if you can do both of them I will be very please.Thank you a lot for every comment.(sorry for my weird english's massage.)
4 ответов
+ 1
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double num = 25;
cout << "Square root of " << num << " is " << sqrt(num);
return 0;
}
+ 1
It means you need to
#include <cmath>
before being able to use it.
http://www.cplusplus.com/reference/cmath/sqrt/
0
Use the sqrt function present in the cmath header
0
Ohh wow it is easier than I think.Thay you everyone you are so kind to me.Thanks