uses crt;
var
A,B,C,D:array [1..3,1..3] of integer;
p,u,i,j,x,y: integer; {faktor pengulang}
pil : char;
label awal,akhir,salah;
begin
awal:clrscr;
begin
clrscr;
gotoxy(5,1);writeln('NAMA KELOMPOK');
gotoxy(5,2);writeln('GERY CASAKOM');
gotoxy(5,4);writeln('PROGARAM PENJUMLAHAN & PERKALIAN DUA MATRIK ORDO DUA');
gotoxy(5,5);writeln('=====================================================');
gotoxy(5,6);write('MASUKKAN NILAI MATRIK A & B ');
gotoxy(4,10);writeln('A :');
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
gotoxy(3*i+5,2*j+6);
read(A[i,j]);
end;readln;end;end;
begin
gotoxy(24,10);writeln('B :');
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
gotoxy(3*i+25,2*j+6);
read(B[i,j]);
end;readln;end;end;
clrscr;
gotoxy(11,4); writeln('Menampilkan Matrik A dan Matrik B');
begin
gotoxy(10,10);writeln('A :');
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
gotoxy(3*i+12,2*j+6);
write(A[i,j]);
end;end;end;
begin
gotoxy(25,10);writeln('B :');
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
gotoxy(3*i+27,2*j+6);
write(B[i,j]);
end;end;end;readln;
begin
Begin
clrscr;
gotoxy(10,5);writeln('HASIL DARI PENJUMLAHAN & PERKALIAN MATRIKNYA');
gotoxy(13,10);writeln('A + B = ');
end;
begin
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
gotoxy(3*i+20,2*j+6);
C[i,j]:=A[i,j]+B[i,j];
write(C[i,j]:3);
end;
end;
Begin
gotoxy(13,19); writeln('A * B = ');
writeln;
for i:=1 to 3 do
begin
for j:=1 to 3 do
begin
gotoxy(3*i+20,2*j+15);
x:=0;
for y:=1 to 3 do
x:=x + A[y,j] * B[i,y];
D[i,j]:=x;
write(D[i,j]:3);
end;end;end;end;end;
salah:begin
writeln;writeln;writeln;writeln;
write(' INGIN MENGULANG LAGI ?(Y/N)');readln(pil);
if (pil='y') or (pil='Y') then goto awal;
if (pil='n') or (pil='N') then goto akhir
else writeln(' PILIHAN HANYA Y / N ');goto salah;
akhir:end;
end.
Rabu, 03 Maret 2010
BELAJAR PASCAL
07.50
HADI SUCIPTO
No comments
0 komentar:
Posting Komentar