Task

Multiply two matrices together.

They can be of any dimensions, so long as the number of columns of the first matrix is equal to the number of rows of the second matrix.




 
module MatrixOps;
type
	Matrix = array {math} *,* of integer;
 
 
	procedure WriteMatrix(x: array {math} *,* of integer);
	var
		i,j: integer;
	begin
		for i := 0 to len(x,0) - 1 do
			for j := 0 to len(x,1) - 1 do
				write(x[i,j]);
			end;
			writeln;
		end	
	end WriteMatrix;
 
	procedure Multiplication;
	var
		a,b: Matrix;
	begin
		a := [[1,2],[3,4],[5,6],[7,8]];
		b := [[1,2,3],[4,5,6]];
		WriteMatrix(a * b);
	end Multiplication;
 
begin
	Multiplication;
end MatrixOps.
 