home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
m
/
mod2tutr.zip
/
EXAMPLES.ZIP
/
CH06E3.MOD
< prev
next >
Wrap
Text File
|
1989-01-18
|
893b
|
43 lines
(* Chapter 6 - Programming exercise 3 *)
MODULE CH06E3;
FROM InOut IMPORT WriteCard, WriteLn;
CONST MaxSize = 8;
VAR BigArray : ARRAY[1..MaxSize] OF ARRAY[1..MaxSize] OF CARDINAL;
Index1, Index2 : CARDINAL;
BEGIN
FOR Index1 := 1 TO MaxSize DO
FOR Index2 := 1 TO MaxSize DO
BigArray[Index1,Index2] := Index1 * Index2;
END;
END;
FOR Index1 := 1 TO MaxSize DO
FOR Index2 := 1 TO MaxSize DO
WriteCard(BigArray[Index1,Index2],4);
END;
WriteLn;
END;
END CH06E3.
(* Result of execution
1 2 3 4 5 6 7 8
2 4 6 8 10 12 14 16
3 6 9 12 15 18 21 24
4 8 12 16 20 24 28 32
5 10 15 20 25 30 35 40
6 12 18 24 30 36 42 48
7 14 21 28 35 42 49 56
8 16 24 32 40 48 56 64
*)