Write an Pascal Program for Two Dimensional Matrix Using Packed Array - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Saturday, September 23, 2017

Write an Pascal Program for Two Dimensional Matrix Using Packed Array


Packed Array Two Dimensional Matrix


Program:
program packedarray;
var
a: packed array [0..3, 0..3] of integer;
i, j : integer;

begin
for i:=0 to 3 do
for j:=0 to 3 do
a[i,j]:= i * j;

for i:=0 to 3 do
begin
for j:=0 to 3 do
write(a[i,j]:2,' ');
writeln;
end;
end.

Output:
0 0 0 0
0 1 2 3
0 2 4 6
1 3 6 9

No comments:

Post a Comment