Matrix Product same index
Matrix Product same index: C-Easy Addon part-008
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
int c[a][b],d[a][b];
for(int i=0;i<a;i++)
for(int j=0;j<b;j++)
scanf("%d",&c[i][j]);
for(int i=0;i<a;i++)
for(int j=0;j<b;j++)
scanf("%d",&d[i][j]);
for(int i=0;i<a;i++)
{ for(int j=0;j<b;j++)
printf("%d ",c[i][j]*d[i][j]);
printf("\n");
}
}
Comments
Post a Comment