+ 3

How do you use square root in a code? on c++

a code displaying sort and comments will be helpful thAnks

8th Aug 2017, 3:37 PM
HJ🐓TDM
3 ответов
+ 2
You posting the language you want it in would also be helpful :) Since I see that you only have C++ as a course I'll just assume you want it in C++ #include <iostream> #include <cmath> // For sqrt int main() { std::cout << sqrt(5); }
8th Aug 2017, 12:56 PM
Dennis
Dennis - avatar
+ 6
In Python and all languages where you have an exponentiation operator, it's sufficient to go like: print(x**.5) # meaning x to the power of ½
8th Aug 2017, 3:40 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
8th Aug 2017, 12:57 PM
Iwan
Iwan - avatar