#include<iosTream.h>
#include<conio.h>
void main()
{
clrscr();
int c[10][10];
for(int g=0;g<10;g++)
{
for(int f=0;f<10;f++)
c[g][f]=0;
}
int a[10][10],b[10][10],r1,r2,c1,c2;
cout<<"enter row x coloumn for 1st matrix\n";
cin>>r1>>c1;
cout<<"enter row x coloumn for 2nd matrix\n";
cin>>r2>>c2;
cout<<"enter 1st array\n";
for(int i=0;i<r1;i++)
{
for(int j=0;j<c1;j++)
cin>>a[i][j];
}
cout<<"enter 2nd array\n";
for(i=0;i<r2;i++)
{
for(int j=0;j<c2;j++)
cin>>b[i][j];
}
// MULTIPLICATION
if(r2==c1)
{
cout<<"\n\nMULTIPLICATON POSSIBLE\n\n";
for(i=0;i<r1;i++)
{
for(int j=0;j<c2;j++)
{
for(int k=0;k<r2;k++)
c[i][j]+=a[i][k]*b[k][j];
}
}
for(i=0;i<r1;i++)
{
for(int j=0;j<c2;j++)
cout<<c[i][j]<<"  ";
cout<<endl;
}
}//if
else
{
cout<<"\n\nMULTIPLICATION NOT POSSIBLE\\n\n";
}
getch();
}