Smallest multiple: Difference between revisions
Smallest multiple in various BASIC dialents (BASIC256, PureBasic and True BASIC)
(Smallest multiple in Asymptote) |
(Smallest multiple in various BASIC dialents (BASIC256, PureBasic and True BASIC)) |
||
Line 148:
{{out}}
<pre>232792560</pre>
=={{header|BASIC}}==
==={{header|BASIC256}}===
<lang freebasic>temp = 2*3*5*7*11*13*17*19
smalmul = temp
lim = 1
do
lim += 1
if (smalmul mod lim) then lim = 1 : smalmul += temp
until lim = 20
print smalmul</lang>
{{out}}
<pre>232792560</pre>
==={{header|PureBasic}}===
<lang PureBasic>OpenConsole()
temp.i = 2*3*5*7*11*13*17*19
smalmul.i = temp
lim.i = 1
Repeat
lim + 1
If (smalmul % lim)
lim = 1
smalmul = smalmul + temp
EndIf
Until lim = 20
PrintN(Str(smalmul))
Input()
CloseConsole()</lang>
{{out}}
<pre>232792560</pre>
==={{header|True BASIC}}===
<lang QBasic>LET temp = 2*3*5*7*11*13*17*19
LET smalmul = temp
LET lim = 1
DO
LET lim = lim+1
IF (REMAINDER(ROUND(smalmul),ROUND(lim)) <> 0) THEN
LET lim = 1
LET smalmul = smalmul+temp
END IF
LOOP UNTIL lim = 20
PRINT smalmul
END</lang>
{{out}}
<pre>232792560</pre>
=={{header|F_Sharp|F#}}==
|