#include
void main()
{
int a[10][10],b[10][20],c[10][10],i,j,m,n,x,y;
clrscr();
printf("Enter the no of rows & coloumns od A");
scanf("%d %d",&x,&n);
printf("Enter the no of rows & columns of B");
scanf("%d %d",&x,&y);
if((m!=x)||(n!=y))
{
printf("Matrix addition not possible");
}
else
{
printf("Enter the element of A");
for(i=0;i
{
for(j=0;j
{
scanf("%d",&b[i][j]);
}
}
printf("Enter the element of B");
for(i=0;i
{
for(j=0;j
scanf("%d",&b[i][j]);
}
for(i=0;i
{
for(j=0;j
{
c[i][j]=a[i][j]+a[i][j];
}
}
for(i=0;i
{
for(j=0;j
{
printf("%d\t",c[i][j]);
}
}
getch();
}
No comments:
Post a Comment