#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main()
{
int r1,c1,r2,c2,a[10][10],b[10][10],c[10][10];
clrscr();
cout<<"Enter how many row in first matrics A : ";
cin>>r1;
cout<<"Enter how many column in first matrics A : ";
cin>>c1;
for(int i=0;i<r1;i++)
for(int j=0;j<c1;j++)
cin>>a[i][j];
cout<<"Enter how many row in second matrics B : ";
cin>>r2;
cout<<"Enter how many column in second matrics B : ";
cin>>c2;
for(i=0;i<r2;i++)
for(j=0;j<c2;j++)
cin>>b[i][j];
if(r1==r2 && c1==c2)
{
for(i=0;i<r1;i++)
for(j=0;j<c1;j++)
{
c[i][j]=0;
for(int k=0;k<c1;k++)
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
cout<<"\nThe multiplication of A & B is : \n";
for(i=0;i<r1;i++)
{
for(j=0;j<c2;j++)
cout<<" "<<c[i][j];
cout<<"\n\n";
}
}
else
printf("\nThe multiplication of A & B is impossible.");
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........