#include<stdio.h>
main()
{
int row,col;
int A[2][2]={3,4,2,6};
printf("Matrix A :\n");
for(row=0;row<2;row++)
{
for(col=0;col<2;col++)
{
printf("\t%d ",A[row][col]);
}
printf("\n\n");
}
///B mat
int B[2][2]={3,2,6,4};
printf("Matrix B :\n");
for(row=0;row<2;row++)
{
for(col=0;col<2;col++)
{
printf("\t%d ",B[row][col]);
}
printf("\n");
}
printf("Sum:\n\n\n");
for(row=0;row<2;row++)
{
for(col=0;col<2;col++)
{
printf("\t%d ",A[row][col]+B[row][col]);
}
printf("\n");
}
}
No comments:
Post a Comment