EasyManua.ls Logo

Commodore 128 - Sample Program

Commodore 128
448 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
This tells the computer to reserve space in its memory for a two-
dimensional array named X. The computer reserves enough
space for 50 numbers. You do not have to fill an array with as
many numbers as you DIMensioned it for, but the computer will
still reserve enough space for all of the positions in the array.
Sample Program
Now it becomes very easy to refer to any number in the chart by
its column and row position. Refer to the chart below. Find the
third element in the tenth row (1500). You would refer to this
number as X(10,3) in your program. The following program reads
the numbers from the chart into a two-dimensional array (X) and
calculates the average of the numbers in each row.
Column
Row 1 2 3
4 5
1 1
3
5
7 9
2
2
4 6 8 10
3 5 10
15 20
25
4
10 20
30 40
50
5 20 40 60 80
100
6 30 60 90
120 150
7
40 80
120 160
200
8
50
100 150
200 250
9 100 200 300
400 500
10 500 1000
1500 2000 2500
4-15

Table of Contents

Other manuals for Commodore 128

Related product manuals