Factors of an integer: Difference between revisions

(Factors of an integer in Chipmunk Basic)
Line 1,516:
</pre>
See also [[#Minimal BASIC|Minimal BASIC]]
 
==={{header|Palo Alto Tiny BASIC}}===
{{trans|GW-BASIC}}
<syntaxhighlight lang="basic">
10 REM FACTORS OF AN INTEGER
20 INPUT "ENTER AN INTEGER"N
30 IF N=0 GOTO 20
40 LET A=ABS(N)
50 IF A=1 GOTO 90
60 FOR I=1 TO A/2
70 IF (A/I)*I=A PRINT I," ",
80 NEXT I
90 PRINT A
100 STOP
</syntaxhighlight>
{{out}}
3 runs.
<pre>
ENTER AN INTEGER:1
1
</pre>
<pre>
ENTER AN INTEGER:60
1 2 3 4 5 6 10 12 15 20 30 60
</pre>
<pre>
ENTER AN INTEGER:-22222
1 2 41 82 271 542 11111 22222
</pre>
 
==={{header|PureBasic}}===
511

edits