I\'m trying to solve a matrix multiplication problem with C. Matrix sizes given in problem (2x2) I wrote this code but it doesn\'t print result as I expect. I think I\'m missing
You can have matrix multiplication of any given size by user in the following manner :
#include
void main()
{
int r1, c1, r2, c2;
printf("Enter number of rows and columns for matrix A : ");
scanf("%d %d",&r1,&c1);
printf("Enter number of rows and columns for matrix B : ");
scanf("%d %d",&r2,&c2);
int a[r1][c1], b[r2][c2], ab[r1][c2], ba[r2][c1],i,j,k,temp;
if(c1==r2 && r1==c2)
{
printf("\nEnter element in matrix A : ");
for(i=0;i