Factors of an integer: Difference between revisions
Content added Content deleted
m (→{{header|PL/0}}: Template {{in}} instead of "For entered".) |
(Factors of an integer in Chipmunk Basic) |
||
Line 1,173: | Line 1,173: | ||
96 => 1 2 3 4 6 8 12 16 24 32 48 96 |
96 => 1 2 3 4 6 8 12 16 24 32 48 96 |
||
</pre> |
</pre> |
||
==={{header|Chipmunk Basic}}=== |
|||
{{works with|Chipmunk Basic|3.6.4}} |
|||
{{trans|BASIC256}} |
|||
<syntaxhighlight lang="qbasic">10 cls |
|||
20 printfactors(11) |
|||
30 printfactors(21) |
|||
40 printfactors(32) |
|||
50 printfactors(45) |
|||
60 printfactors(67) |
|||
70 printfactors(96) |
|||
80 end |
|||
100 sub printfactors(n) |
|||
110 if n < 1 then printfactors = 0 |
|||
120 print n "=> "; |
|||
130 for i = 1 to n/2 |
|||
140 if n mod i = 0 then print i " "; |
|||
150 next i |
|||
160 print n |
|||
170 end sub</syntaxhighlight> |
|||
{{out}} |
|||
<pre>Same as FreeBASIC entry.</pre> |
|||
==={{header|FutureBasic}}=== |
==={{header|FutureBasic}}=== |