int i,j,r,c,first[5][5],second[10][10],sum[10][10];
printf("enter the no. of rows u want to enter in matrix\n");//enter the order of 1st matrix in 2d array
scanf("%d",&r);
printf("enter the no. of column u want to enter in matrix\n");
scanf("%d",&c);
for(i=0;i<r;i++)//
{
for(j=0;j<c;j++)
{
printf("ENTER first[%d][%d]=\n",i,j);
scanf("%d",&first[i][j]);//enter like 00..01..02...10...11...12..1st matrix..
}
}
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("ENTER second[%d][%d]=\n",i,j);//enter the 2nd matrix of same order as like 1st matrix..//
scanf("%d",&second[i][j]);
}
}
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
sum[i][j]=first[i][j]*second[i][j];//add each element of 1st matrix to element of same position in 2nd matrix....to get sum in 3rd matrix...at same position means at same value of i & j...
printf("sum[%d][%d]=%d\n",i,j,sum[i][j]);//also print all the elements of 3rd matrix..