Satu lagi nih program matriks yang saya buat, kali ini hanya menampilkan hasil inputan matrik 2 x 2, langsung saja copy paste source codenya di bawah siniii....
program matrik;
uses wincrt;
var
baris,kolom : integer;
matrika : array[1..5,1..5] of integer;
matrikb : array[1..5,1..5] of integer;
begin
writeln('MATRIKS ORDO 2 X 2');
writeln;
writeln('Inputkan nilai matrik A');
for baris :=1 to 2 do
begin
for kolom :=1 to 2 do
begin
write('Masukkan Matriks A ',baris,',',kolom,': '); readln(matrika[baris,kolom]);
end;
end;
writeln;
writeln('Inputkan nilai matrik B');
for baris :=1 to 2 do
begin
for kolom :=1 to 2 do
begin
write('Masukkan Matriks B ',baris,',',kolom,': '); readln(matrikb[baris,kolom]);
end;
end;
writeln;
writeln('TAMPILAN MATRIKS A DAN B');
writeln('========================');
for baris :=1 to 2 do
begin
writeln;
for kolom :=1 to 2 do
begin
write(' ',matrika[baris,kolom]);
end;
end;
writeln;
writeln;
for baris :=1 to 2 do
begin
writeln;
for kolom :=1 to 2 do
begin
write(' ',matrikb[baris,kolom]);
end;
end;
end.
0 komentar:
Post a Comment