Thursday, February 27, 2014

Sum of Matrix

#include<stdio.h>
#include<conio.h>
#include<windows.h>
main()
{
int a[2][3], b[2][3];
int i,j;
printf("Enter the First Matrix Row wise: ");
for(j=0;j<3;j++)
{
for(i=0;i<2;i++)
{
scanf("%d", &a[i][j]);
}
}
system("cls");
printf("Enter the Second Matrix Row wise : ");
for(j=0;j<3;j++)
{
for(i=0;i<2;i++)
{scanf("%d", &b[i][j]);}
}
system("cls");
printf("The Sum Of two Matix is : \n");
for(j=0;j<3;j++)
{
for(i=0;i<2;i++)
{ printf("\t\t%d\t\t",a[i][j]+b[i][j]);
}
printf("\n");
}
getch();
}

No comments:

Post a Comment