Factors of an integer: Difference between revisions

Content deleted Content added
Nig (talk | contribs)
m →‎{{header|AppleScript}}: "Straighforward" solution: fixed bug that was missing factors for some numbers.
Thebigh (talk | contribs)
add gw basic
Line 1,004: Line 1,004:
1 , 2 , 3 , 6 , 43 , 86 , 127 , 129 , 254 , 258 , 381 , 762 , 5461 , 10922 ,
1 , 2 , 3 , 6 , 43 , 86 , 127 , 129 , 254 , 258 , 381 , 762 , 5461 , 10922 ,
16383 , 32766
16383 , 32766
</pre>

==={{header|GW-BASIC}}===
<lang gwbasic>
10 INPUT "Enter an integer: ", N
20 IF N = 0 THEN GOTO 10
30 FOR I = 1 TO ABS(N)/2
40 IF N MOD I = 0 THEN PRINT I;
50 NEXT I
60 PRINT N</lang>
{{out}}
<pre>
Enter an integer: 1
1
Enter an integer: 12
1 2 3 4 6 12
Enter an integer: 13
1 13
Enter an integer: -22222
1 2 41 82 271 542 11111 -22222
</pre>
</pre>