Smallest square that begins with n: Difference between revisions

Added solution for Action!
(Add BQN)
(Added solution for Action!)
Line 4:
Find the smallest &nbsp;(decimal integer)&nbsp; squares that begin with &nbsp; &nbsp; <big> '''n''' </big> &nbsp; &nbsp; for &nbsp; <big> 0 &lt; '''n''' &lt; 50 </big>
<br><br>
 
=={{header|Action!}}==
<lang Action!>CARD FUNC GetNumber(BYTE x)
CARD i,sq
 
i=1
DO
sq=i*i
WHILE sq>x
DO
sq==/10
OD
IF sq=x THEN
RETURN (i*i)
FI
i==+1
OD
RETURN (0)
 
PROC Main()
BYTE i
CARD num
 
FOR i=1 TO 49
DO
num=GetNumber(i)
PrintC(num) Put(32)
OD
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Smallest_square_that_begins_with_n.png Screenshot from Atari 8-bit computer]
<pre>
1 25 36 4 529 64 729 81 9 100 1156 121 1369 144 1521 16 1764 1849 196 2025 2116 225 2304 2401 25 2601 2704 289 2916 3025 3136 324 3364 3481 3585 36 3721 3844 3969 400 4160 4225 4356 441 4529 4624 4761 484 49
</pre>
 
=={{header|ALGOL 68}}==
Anonymous user