Factors of an integer: Difference between revisions
Content added Content deleted
(Added Tiny BASIC example) |
|||
Line 995: | Line 995: | ||
{{out}} |
{{out}} |
||
<pre>1 3 5 7 9 15 35 45 63 105 315</pre> |
<pre>1 3 5 7 9 15 35 45 63 105 315</pre> |
||
==={{header|Tiny BASIC}}=== |
|||
<lang Tiny BASIC>100 PRINT "Give me a number:" |
|||
110 INPUT I |
|||
120 LET C=1 |
|||
130 PRINT "Factors of ",I,":" |
|||
140 IF I/C*C=I THEN PRINT C |
|||
150 LET C=C+1 |
|||
160 IF C<=I THEN GOTO 140 |
|||
170 END</lang> |
|||
{{out}} |
|||
<pre>Give me a number: |
|||
60 |
|||
Factors of 60: |
|||
1 |
|||
2 |
|||
3 |
|||
4 |
|||
5 |
|||
6 |
|||
10 |
|||
12 |
|||
15 |
|||
20 |
|||
30 |
|||
60 |
|||
</pre> |
|||
=={{header|Batch File}}== |
=={{header|Batch File}}== |