Smallest square that begins with n: Difference between revisions

Smallest square that begins with n in BASIC256 and True BASIC
(Smallest square that begins with n in BASIC256 and True BASIC)
Line 302:
41209 4225 4356 441 45369
4624 4761 484 49</pre>
 
==={{header|BASIC256}}===
<lang freebasic>print "Prefix n^2 n"
print "-----------------------------"
 
for i = 1 to 49
j = 1
while true
k = j ^ 2
while k > i
k = int(k / 10)
end while
if k = i then
print i, j*j, int(sqr(j^2))
exit while
end if
j += 1
end while
next i</lang>
{{out}}
<pre>Igual que la entrada de FreeBASIC.</pre>
 
==={{header|True BASIC}}===
<lang QBasic>PRINT "Prefix n^2 n"
PRINT "------------------------------------"
 
FOR i = 1 to 49
LET N = 1
DO
LET j = N ^ 2
DO WHILE j > i
LET j = int(j / 10)
LOOP
IF j = i then
PRINT i, N^2, sqr(N^2)
EXIT DO
END IF
LET N = N + 1
LOOP
NEXT i
END</lang>
{{out}}
<pre>Igual que la entrada de FreeBASIC.</pre>
 
 
=={{header|BQN}}==
2,169

edits