Program for Matrix Addition
#include<iostream.h> #include<conio.h> void main() { int a[3][3],b[3][3],c[3][3],i,j; clrscr(); cout<<"Enter the Elements of the Ist Matrix"; for(i=0;i<3;i++) for(j=0;j<3;j++) cin>>a[i][j]; cout<<"Enter the Elements of the IInd Matrix"; for(i=0;i<3;i++) for(j=0;j<3;j++) cin>>b[i][j]; //Sum starts here for(i=0;i<3;i++) for(j=0;j<3;j++) c[i][j]=a[i][j]+b[i][j]; cout<<"\nThe addition of input Matrix is\n"; for(i=0;i<3;i++) { cout<<"\n"; for(j=0;j<3;j++) cout<<"\t"<<c[i][j]; } cout<<"\nPress any key to continue..."; getch(); } Output Enter the Elements of the Ist Matrix 1 2 3 4 5 ...