![Write a C Program to Multiply Two Matrix Multiply Two Matrix, Sumit kAr, Timus rak](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgEEuiVQujzDYGlv1PMDzDKYb5ozvCbIjo_Mt3FOu_A8h6GVex9UkCglRQEuc0wTKxbm_OgzCSMsAl0xTsTrdYwnZVmL3fFis99MAlE7B7SZTE3u-l8-Yoy14a7zhjLCMXS_y2grkLeaBz/s1600/c-programming-tutorial.jpg)
#include<stdio.h>
void main()
{
int arr1[3][3],arr2[3][3],arr3[3][3]={0},i,j,k;
printf("Type a matrix of 3 rows & 3 colomns :\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%d",&arr1[i][j]);
printf("Type another matrix of 3 rows & 3 colomns :\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
scanf("%d",&arr2[i][j]);
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<3;k++)
arr3[i][j]=arr3[i][j]+arr1[i][k]*arr2[k][j];
}
}
printf("\n\nOutput:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%5d",arr3[i][j]);
printf("\n\n");
}
}
0 Comments