Professional Documents
Culture Documents
*******************************************************************************/
#include <stdio.h>
#include <stdio.h>
int main()
{
int row1,row2,col1,col2,i,j;
int M1[row1][col1],M2[row2][col2];
printf ("Enter No. of Rows & Columns of 1st Matrix:\n");
scanf("%d%d",&row1,&col1);
printf ("\nEnter No. of Rows & Columns of 2nd Matrix:\n");
scanf("%d%d",&row2,&col2);
if(col1==row2)
{
for(i=0;i<row1;i++)
{
for(j=0;j<col1;j++)
{
scanf("%d",&M1[i][j]);
}
}
for(i=0;i<row1;i++)
{
for(j=0;j<col1;j++)
{
scanf("%d",&M2[i][j]);
}
}
}
else
{
printf("Multiplication of this matrix is not possible.\nPlease Enter
Matrices such that column of 1st matrix = row of 2nd matrix,");
}
return 0;
}