+ 7
CHALLENGE
I challenge you to write a program calculate the square root without use "scrt" function.
4 Answers
+ 13
print(int(input())**0.5)
#Python
+ 6
#include <iostream>
#include <cmath>
int mysqrt(int n)
{
return pow(n, 0.5);
}
int main()
{
int num = 144;
std::cout << "Square root of " << num << " = " << mysqrt(num);
return 0;
}
+ 5
you only need to know how sqrt works or his formula, all the rest will be easy.
+ 5
Without using any math functions, no sqrt or pow functions.
https://code.sololearn.com/WEGfbB4jnO3Q/?ref=app