#include <stdio.h>
#define M 3
#define N 4
#define P 5
void
multmatrix (int a[M][N], int b[N][P], int c[M][P])
{
int i,j,k;
for (i=0; i<M; ++i)
for (j=0; j<P; ++j)
{
c[i][j]=0.0;
for (k=0; k<N; ++k)
c[i][j] = c[i][j] + a[i][k] * b[k][j];
}
}
int
main (void)
{
int i,j;
int mat1[M][N]={{1,2,2,2},{2,-3,6,4},{8,1,0,-3}};
int mat2[N][P]={{1,1,1,0,3},{2,3,1,6,2},{1,-1,-1,8,3},{0,1,2,3,4}};
int matprod[M][P];
multmatrix (mat1, mat2, matprod);
for (i=0; i<M; ++i)
{
for (j=0; j<P; ++j)
printf ("%4d ", matprod[i][j]);
printf ("\n");
}
return (0);
}