This document was uploaded by user and they confirmed that they have the permission to share
it. If you are author or own the copyright of this book, please report to us by using this DMCA
report form. Report DMCA
{*Program 1*} (*FY B C A*) {program: To find multiplication of two matrices} program matrix(multi); uses crt; var a,b,c:array [1..3,1..3] of integer; i,j,k:integer; begin clrscr; writeln('first matrix'); for i:=1 to 3 do begin for j:=1 to 3 do begin read(a[i,j]); end; end; writeln('second matrix'); for i:=1 to 3 do begin for j:=1 to 3 do begin read(b[i,j]); end; end; for i:=1 to 3 do begin for j:=1 to 3 do begin c[i,j]:=0; for k:=1 to 3 do begin c[i,j]:=c[i,j]+a[i,k]*b[k,j]; end; end; end; writeln('Sum of Matrices') for i:=1 to 3 do begin for j:=1 to 3 do begin write(c[i,j]:3); end; writeln; end; end. \\{end of the program} Output: first matrix 111 111 111 second matrix 222 222 222 Multiplication of Matrices 666 666 666
\\{beginning of the program} \\{beginning of first for loop}
\\{end of first for loop} \\{beginning of second for loop}
\\{end of second for loop} \\{beginning of third for loop}