// Write a C program Multiplication of Two Matrices.
#include<stdio.h>
#include<conio.h>
void main()
{
int a[25][25],b[25][25],c[25][25],i,j,m,n,k,r,s;
clrscr();
printf("enter the rows and colums of A matrics:\n");
scanf("%d%d",&m,&n);
printf("enter the rows and colums of B matrics:\n");
scanf("%d%d",&r,&s);
printf("\nenter the elements of A matrics");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("\t%d",&a[i][j]);
}
printf("\nenter the elements of B matrics");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("\t%d",&b[i][j]);
}
printf("\nThe elements of A matrics");
for(i=0;i<m;i++)
{
printf("\n");
for(j=0;j<n;j++)
printf("\t%d",a[i][j]);
}
printf("\nThe elements of B matrics");
for(i=0;i<m;i++)
{
printf("\n");
for(j=0;j<n;j++)
printf("\t%d",b[i][j]);
}
for(i=0;i<m;i++)
{
printf("\n");
for(j=0;j<n;j++)
{
c[i][j]=0;
for(k=0;k<m;k++)
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
}
printf("\nThe Multiplication of two matrics");
for(i=0;i<m;i++)
{
printf("\n");
for(j=0;j<n;j++)
printf("\t%d",c[i][j]);
}
getch();
}