Babbage problem: Difference between revisions
m
→{{header|BBC BASIC}}
(Clarified that the task refers to positive integers) |
|||
Line 9:
<lang bbcbasic>REM Statements beginning 'REM' are explanatory remarks: the machine will ignore them.
REM We shall test
REM A number that ends in 269,696 is one that leaves a remainder of 269,696 when divided by a million.
REM So we are looking for a
REM Observe that in this notation groups of digits may not be separated by commas.
Line 24:
REM 'REPEAT... UNTIL' causes the machine to perform the addition repeatedly until the condition is satisfied.
PRINT "The smallest number whose square ends in 269696 is" n
PRINT "Its square is" n^2</lang>
{{out}}
<pre>The smallest number whose square ends in 269696 is 25264
|