home *** CD-ROM | disk | FTP | other *** search
- 10 rem problem #23-2 :
- 20 rem rooting routine
- 30 rem solution by thomson fung
- 40 rem
- 50 print"to exit, type a # < 1"
- 60 input"enter a # from 1 to 65535";d
- 70 if d<0 then end
- 80 x=100 : rem any initial value > 0
- 90 for i=1 to 10
- 100 x=.5*(x+d/x)
- 110 next i
- 120 print"square root of"d"="int(x+.5)
- 130 print : print : goto 50
-