Solution:
#include<stdio.h>
void main()
{
int a[2][2],b[2][2],c[2][2],i,j;
clrscr();
printf("Enter the value of First 2 x 2 Matrix : ");
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("Enter the value of Second 2 x 2 Matrix : ");
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
scanf("%d",&b[i][j]);
}
}
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
c[i][j]=a[i][j]*b[i][j];
printf("Sum of Two Matrix : %d\n",c[i][j]);
}
}
getch();
}
0 Comments