September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
11
Task/Factorial/BASIC/factorial-3.basic
Normal file
11
Task/Factorial/BASIC/factorial-3.basic
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
10 REM FACTORIAL
|
||||
20 REM COMMODORE BASIC 2.0
|
||||
30 N = 10 : GOSUB 100
|
||||
40 PRINT N"! ="F
|
||||
50 END
|
||||
100 REM FACTORIAL CALC USING SIMPLE LOOP
|
||||
110 F = 1
|
||||
120 FOR I=1 TO N
|
||||
130 F = F*I
|
||||
140 NEXT
|
||||
150 RETURN
|
||||
6
Task/Factorial/BASIC/factorial-4.basic
Normal file
6
Task/Factorial/BASIC/factorial-4.basic
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
10 INPUT N
|
||||
20 LET FACT=1
|
||||
30 FOR I=2 TO N
|
||||
40 LET FACT=FACT*I
|
||||
50 NEXT I
|
||||
60 PRINT FACT
|
||||
10
Task/Factorial/BASIC/factorial-5.basic
Normal file
10
Task/Factorial/BASIC/factorial-5.basic
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
10 INPUT N
|
||||
20 LET FACT=1
|
||||
30 GOSUB 60
|
||||
40 PRINT FACT
|
||||
50 STOP
|
||||
60 IF N=0 THEN RETURN
|
||||
70 LET FACT=FACT*N
|
||||
80 LET N=N-1
|
||||
90 GOSUB 60
|
||||
100 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue