You are on page 1of 1

int prod_matrice(double a[][10],int m,int n,double b[][10],int p,int q,double c[]

[10],int *r,int *s)


{int i,j,k,er;
if(n!=p)
er=1;
else
{er=0;
*r=m;
*s=q;
for(i=0;i<*s;i++)
for(j=0;j<*s;j++)
{c[i][j]=0;
for(k=0;k<n;k++)
c[i][j]+=a[i][k]*b[k][j];
}
}
return er;
}
Ex Apel:
double mat1[10][10],mat2[10][10],mat3[10][10];
int l1,c1,l2,c2,l3,c3,er;
er=prod_matrice(mat1, l1,c1,mat2,l2,c2,mat3,&l3,&c3);

You might also like