/* Write a program to Add two Matrices. i.e. C= A + B. (Matrix Addition) */ #include<stdio.h> #define size 5 int main() { int c[size][size],a[size][size],b[size][size],i,j,m1,n1,m2,n2; printf("Enter the order of 1st matrix \n"); printf("Rows \t"); scanf("%d",&m1); printf("\n Column\t"); scanf("%d",&n1); printf("Enter the order of 2st matrix \n"); printf("Rows\t"); scanf("%d",&m2); printf("\n Column\t"); scanf("%d",&n2); if(m1!=m2 && n1!=n2) { printf("\nMatrix Addition is not possible"); } else { printf("\nEnter the elements of 1st array"); for(i=0;i<m1;i++) { for(j=0;j<n1;j...
Comments
Post a Comment