How to make a squaroot in c++ | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
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.)

31st Jan 2019, 2:52 PM
Riewway
Riewway - avatar
4 Respuestas
+ 1
#include <iostream> #include <cmath> using namespace std; int main() { double num = 25; cout << "Square root of " << num << " is " << sqrt(num); return 0; }
31st Jan 2019, 3:08 PM
Random
Random - avatar
+ 1
It means you need to #include <cmath> before being able to use it. http://www.cplusplus.com/reference/cmath/sqrt/
31st Jan 2019, 3:11 PM
Zen
Zen - avatar
0
Use the sqrt function present in the cmath header
31st Jan 2019, 2:57 PM
Random
Random - avatar
0
Ohh wow it is easier than I think.Thay you everyone you are so kind to me.Thanks
31st Jan 2019, 3:26 PM
Riewway
Riewway - avatar