void main()
Author: Sanif S S
Site: theeduzone.blogspot.com
Email: sanifss@gmail.com#include<stdio.h>
#include<conio.h>
{
clrscr();
int m1[20][20],m2[20][20],s[20][20],i,j,m,n,p,q;
printf("\nenter the order of the first matrix : ");
scanf("%d %d",&m,&n);
printf("\nenter the order of the second matrix : ");
scanf("%d %d",&p,&q);
if((m==p)&&(n==q))
{
printf("\n\nenter the elements of first matrix : ");
for(i=0;i
printf("\nenter the elements of second matrix : ");
for(i=0;i
for(j=0;j
scanf("%d",&m2[i][j]);
printf("\n\nfirst matrix : \n");
for(i=0;i{
for(j=0;jprintf(" %d ",m1[i][j]);
printf("\n");
}
printf("\nsecond matrix : \n");
for(i=0;i
{
for(j=0;j
for(j=0;j
printf(" %d ",m2[i][j]);printf("\n");
}
printf("\nsum of the two matrices :\n");
for(i=0;i{
for(j=0;j{
s[i][j]=m1[i][j]+m2[i][j];
printf(" %d ",s[i][j]);
}
printf("\n");
}
}
else
{
printf("\n\n\naddition not possible");
}
getch();
}
No comments:
Post a Comment