addition of two matrices
TRANSCRIPT
![Page 1: addition of two matrices](https://reader036.vdocuments.us/reader036/viewer/2022082708/55d36ec1bb61ebc31b8b4642/html5/thumbnails/1.jpg)
This program let you to add two matrices of same size and displaying the elements of resultant matrix.
void main(){ int a[2][2], b[2][2], c[2][2]; printf("enter the elements of matrix a\n"); for(i=0 ; i<=1 ; i++) { for(j=0 ; j<=1 ; j++) { scanf("%d",&a[i][j]); } }
printf("enter the elements of matrix b\n"); for(i=0 ; i<=1 ; i++) { for(j=0 ; j<=1 ; j++) { scanf("%d",&b[i][j]); } }
printf("the sum of two matrices is \n"); for(i=0 ; i<=1 ; i++) { for(j=0 ; j<=1 ; j++) { printf("%d\n",a[i][j] + b[i][j]); } }}output
enter the elements of matrix a123
![Page 2: addition of two matrices](https://reader036.vdocuments.us/reader036/viewer/2022082708/55d36ec1bb61ebc31b8b4642/html5/thumbnails/2.jpg)
4enter the elements of matrix b1234the sum of two matrices is 2468