0% found this document useful (0 votes)
414 views3 pages

Perkalian Matrik

This document describes a Pascal program for matrix multiplication. It defines three matrices - A, B, and C - where A and B are input and C will store the result of multiplying A and B. The program prompts the user to input values for the matrices A and B, then calculates the product of A and B, storing the result in matrix C. It then displays the result matrix C.

Uploaded by

Antonio Grafiko
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
414 views3 pages

Perkalian Matrik

This document describes a Pascal program for matrix multiplication. It defines three matrices - A, B, and C - where A and B are input and C will store the result of multiplying A and B. The program prompts the user to input values for the matrices A and B, then calculates the product of A and B, storing the result in matrix C. It then displays the result matrix C.

Uploaded by

Antonio Grafiko
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Perkalian matrik

program perkalian_matriks;
uses
wincrt;
const
n_i=3;
n_j=2;
n_k=2;
var
A: array [1..n_i,1..n_j] of integer;
B: array [1..n_j,1..n_k] of integer;
C: array [1..n_i,1..n_k] of integer;
i,j,k:integer;
begin
clrscr;
writeln('penetapan nilai matriks A');
for i:=1 to n_i do
for j:=1 to n_j do
begin
write('baris ke-',i,'kolom ke-',j,' :');
readln(A[i,j]);
end;
writeln('penetapan nilai matriks B');
for j:=1 to n_j do
for k:=1 to n_k do
begin
write('baris ke-',j,'kolom ke-',k,' :');
readln(B[j,k]);
end;
writeln('Perhitungan sedang dilakukan..');
for i:= 1 to n_i do
for k:= 1 to n_k do
begin
C[i,k] :=0;
for j:= 1 to n_j do
C[i,k] := C[i,k]+A[i,j] * B[j,k];
end;
writeln('Maka nilai matriks C');
for i:=1 to n_i do
begin
for k:=1 to n_k do
write(C[i,k]:4);
writeln;
end;
readln;
end.

You might also like