Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Babbage-problem/Commodore-BASIC/babbage-problem.basic
Normal file
12
Task/Babbage-problem/Commodore-BASIC/babbage-problem.basic
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
10 rem This code is an implementation of Babbage Problem
|
||||
20 num = 100 : rem We can safely start at 100
|
||||
30 s = num*num
|
||||
40 r = s - int(s/1000000)*1000000 : rem remainder when divided by 1,000,000
|
||||
50 if r = 269696 then goto 100 : rem compare with 269,696
|
||||
60 print "n="num"sq="s"rem="r
|
||||
70 num = num+1
|
||||
80 goto 30
|
||||
90 rem Print out the result
|
||||
100 print:print "The smallest number whose square ends in 269696 is:"
|
||||
110 print num;"....";num;"squared = ";s
|
||||
120 end
|
||||
Loading…
Add table
Add a link
Reference in a new issue