Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to tell which value is on 2by3 of a matrix which is 3by3

+1 vote
asked May 5, 2019 by Maham basit (130 points)

2 Answers

0 votes
answered May 16, 2019 by shivant (140 points)
#include<stdio.h>
int main()
{
    
    int r1,c1,r2,c2,i,j,k,arr1[10][10],arr2[10][10],res[10][10],sum=0;
    scanf("%d%d%d%d",&r1,&c1,&r2,&c2);
    if(c1==r2)
{
     printf("Enter the matrix of element of arr1:\n");
     for(i=0;i<r1;i++)
     {
         for(j=0;j<c1;j++)
         scanf("%d",&arr1[i][j]);
     }
     printf("Enter the elementof arr2 matrix:\n");
      for(i=0;i<r2;i++)
     {
         for(j=0;j<c2;j++)
         scanf("%d",&arr2[i][j]);
     }
      for(i=0;i<r2;i++)
     {
         for(j=0;j<c1;j++)
         {
         for(k=0;k<c1;k++)
         {
         sum+=arr1[i][k]*arr2[k][j];
         }
         res[i][j]=sum;
         sum=0;
         }
         
         
     }
     printf("after multiplication of matrix is:\n");
     for(i=0;i<r2;i++)
     {
     for(j=0;j<c2;j++)
     printf("%d ",res[i][i]);
     printf("\n");
     return 0;
}
}
else
printf("Multiplication not valid");
}
0 votes
answered Jun 22, 2019 by Robert Parry (240 points)
matrix[2][3]
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...