+ 5
[CHALLENGE] Write A Code That Calculates and Prints The Square Root Of A Number Without Using The Built-In Function or **.5!
Title says it all, try to write a code that calculates and prints the square root of a number without using the built-in function or using to the 1/2 power. My code is below for reference! (There may be a much better solution than mine but this is what I have!) Any language welcome! Mine is in Python. Try to do: At least 5 decimal places, 10 places, 15 You may use the built-in squared function in your code and to check your solution! https://code.sololearn.com/cv9nDlouI2uI/?ref=app
9 Antworten
+ 20
https://code.sololearn.com/cgpNcEa2jIXa/?ref=app
+ 15
#My try in Python ✌️ (1 Liner)
print(float(input())**.5)
+ 7
Used à little bit of math to avoid sqrt() and ** :)
https://code.sololearn.com/cj7xyA0lNcGi/?ref=app
https://code.sololearn.com/c1uNsP1qvpLx/?ref=app
https://code.sololearn.com/c43oH928fyE2/?ref=app
https://code.sololearn.com/cYdoZU7pW8B9/?ref=app
+ 5
https://code.sololearn.com/cJCYuZOgG3vC/?ref=app
+ 2
https://code.sololearn.com/c2Sh2DDR7qcC/#cs
+ 1
Nice DT! I should have specified that I wanted you to try and not use the 1/2 power as well! I’ve updated my Challenge