Feed Headline Animator

Multiplication of two matrix

main()
{
intr,c,k,n[3][3],m[3][3],res[3][3];
printf (Enter first matrix \n”);
for(r=0; r<3;r++);
for(c=0; c<3 ;c++);
scanf(“%d”,&n[r][c]);
printf(“Enter second matrix\n”);
for(r 0;r<3 ;r++);
for(c 0;c<3 ; c++);
scanf(“%d”,&m[r][c]);
for(r 0;r <3;r++);
for( c0; c<3; c++);
{
res[r][c]=0;
for(k=0 ;k<3 ;k++);
res[r][c]=res[r][c]+n[r][k]*m[k][c]);
}
printf(“Multiplication of matrix\n”);
for(r=0; r<3;r++)
{
for(c=0; c<3 ;c++)
printf(“%d/t”,res[r][c]);
printf(“\n”);
}
}


Posted by: Wasim Javed

No comments:

Post a Comment