Pages

Wednesday, November 11, 2015

Pascal Program of Matrix Multiplication

program NameArray;
var
A , B, C : Array [1..5,1..5] of integer;
d, e : integer;
Begin
  for d := 1 to 5 do
   Begin
  for e := 1 to 5 do
    Begin
writeln ('input your numbers for A');
readln (A[d , e] );
end;
end;
  begin
  writeln;
   for d := 1 to 5 do
     begin
   for e := 1 to 5 do
  begin
  writeln ('enter a number for b');
  readln (B [d , e] );
  end;
  end;
  begin
for d:= 1 to 5
begin
for e:= 1 to 5
C [d , e] := C [d ,e] + A [d , e]  × B [ d, e];
end;
writeln (' The answers are');
readln;
writeln;
writeln;
for d := 1 to 5 do
begin
for e := 1 to 5 do
write ( C[ d, e], '  ' :2);
Writeln;
end;
end;
end;
readln;
End.