You are on page 1of 1

/******************************************************************************

Welcome to GDB Online.


GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#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;
}

You might also like