Radio Shack TRS-80 PC-3 Owner's Manual page 133

Table of Contents

Advertisement

Examples
10 FOR I
=
1 TO
5
20 PRINT I
30 NEXT I
This group of statements prints the numbers 1,2,3,4,5.
40 FOR N
=
10 TO 0
STEP~-1 This group of statements counts down 10,9,8,7,6,5,4,3,2,1,0.
50 PRINT N
60 NEXT N
70 FOR N
=
1 TO 10
80
X
=
1
90 FOR F
=
1 TO N
100 X
=
X
*
F
110 NEXT F
120 PRINT X
130 NEXT N
This group of statements computes and prints N factorial for the numbers from 1 to 10.
133

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents