How to find square root of an integer.. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

How to find square root of an integer..

i made an algorithm but it is wrong ... could u help to get the right way to find square root..

19th Mar 2018, 2:32 AM
Roshan Kumar
Roshan Kumar - avatar
3 Respuestas
+ 16
thats easy 1) number must be +ve as sq. ia always +ve 2) now run a loop from x=1 to x <=n/2 3) see whether x*x==n return true or not 4) if return true , just print x & break //hope it helps , I think simple only 😅
19th Mar 2018, 8:35 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
19th Mar 2018, 4:26 AM
Kartikey Sahu
Kartikey Sahu - avatar
0
Most programming languages have a math library containing a square root function
19th Mar 2018, 2:49 AM
Ariela
Ariela - avatar