Acorn Computers BBC Micro Model B w/8271 — Acorn BBC Micro Model B w/8271 User Guide Manual PDF (EN)

38 70 ON ERROR GOTO 300 80 @%=&2030A 90 REPEAT 100 count=0 110 REPEAT 120 INPUT "What is your number ",N 130 UNTIL N>0 140 DELTA=N 150 ROOT=N/2 160 T=TIME 170 REPEAT 180 count=count+1 190 DELTA=(N/ROOT-ROOT)/2 200 ROOT=ROOT+DELTA 210 UNTIL ABS(DELTA) 220 T=TIME-T 230 PRINT 240 PRINT "Number ",N 250 PRINT "Root ",ROOT 260 PRINT "Iterations",count 270 PRINT "Time",T/100;" seconds" 280 PRINT'' 290 UNTIL FALSE 300 @%=&90A:PRINT:REPORT:PRINT >RUN What is your number?34 Number 34.000 Root 5.831 Interations 5.000 Time 0.070 seconds What is your number?125 Number 125.000 Root 11.180 Interations 6.000 Time 0.080 seconds What is your number?