Gan kali ini saya Akan Melakukan postingan tentang array multi demensi...
contoh programnya adalah :
{array multi dimensi}
uses crt;
var x : array[1..3,1..4] of integer;
a,b,max,min : integer;
begin
clrscr;
for a:=1 to 3 do
begin
for b:=1 to 4 do
begin
write('input matrix ke ',a,'-',b,' : '); readln(x[a,b]);
end;
end;
writeln; writeln('DALAM BENTUK MATRIX'); writeln;
for a:=1 to 3 do
begin
for b:=1 to 4 do
begin
write(x[a,b]:4);
end;
writeln;
end;
min:=x[1,1];
max:=x[1,1];
for a:= 1 to 3 do
begin
for b:=1to 4 do
begin
if x[a,b] >= max then
max:=x[a,b];
if x[a,b]<= min then
min:=x[a,b];
end;
end;
writeln(' NIlai tertinggi :',max);
writeln(' Nilai terendah :',min);
writeln(' Maaf saya dalam proses belajar ');
readln;
end.
Setelah Dijalankan Akan menampilkan output seperti dibawah ini .....
Selamat Mencoba Gan.....
goodluck
Home »Unlabelled » Contoh Array Multi Dimensi
{ 1 comments... read them below or add one }
This comment has been removed by the author.
Post a Comment