Jump to content

Factors of an integer: Difference between revisions

Added MSX Basic and Quite BASIC
(Added MSX Basic and Quite BASIC)
Line 1,481:
{{trans|GW-BASIC}}
{{works with|Commodore BASIC}}
{{works with|MSX BASIC|any}}
{{works with|Nascom ROM BASIC|4.7}}
<syntaxhighlight lang="gwbasic">10 REM Factors of an integer
10 REM Factors of an integer
20 PRINT "Enter an integer";
30 INPUT N
Line 1,493:
90 NEXT I
100 PRINT N1
110 END</syntaxhighlight>
 
</syntaxhighlight>
==={{header|MSX Basic}}===
{{trans|GW-BASIC}}
<syntaxhighlight lang="qbasic">10 INPUT "Enter an integer: "; N
20 IF N = 0 THEN GOTO 15
30 N1 = ABS(N)
40 FOR I = 1 TO N1/2
50 IF N1 MOD I = 0 THEN PRINT I;
60 NEXT I
70 PRINT N1</syntaxhighlight>
 
==={{header|Quite BASIC}}===
{{trans|GW-BASIC}}
<syntaxhighlight lang="qbasic">10 INPUT "Enter an integer: "; N
20 IF N = 0 THEN GOTO 15
30 N1 = ABS(N)
40 FOR I = 1 TO N1/2
50 IF N1 - INT(N1 / I) * I = 0 THEN PRINT I; " ";
60 NEXT I
70 PRINT N1</syntaxhighlight>
 
==={{header|Nascom BASIC}}===
2,136

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.