Skip to content

Latest commit

 

History

History
79 lines (64 loc) · 1.22 KB

Rohan-Godha.md

File metadata and controls

79 lines (64 loc) · 1.22 KB

Rohan Godha C:\Users\yoyor\OneDrive\Desktop India https://github.com/RohanGodha

#include <stdio.h>

int main() { int arr1[3][3]; int arr2[3][3]; int i,j; printf("Enter the values of first matrix\n "); for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { scanf("%d",&arr1[i][j]); } } printf("\nThe first matrix is :\n"); for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { printf("%d ",arr1[i][j]); } printf("\n"); } printf("\n\n");

printf("Enter the values of second matrix : "); for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { scanf("%d",&arr2[i][j]); } } printf("\nThe second matrix is :\n"); for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { printf(" %d ",arr2[i][j]); } printf("\n"); } printf("\n\n");

int sum[i][j]; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { sum[i][j]=arr1[i][j]+arr2[i][j]; } }

for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { printf("%d ",sum[i][j]); } printf("\n");

}

return 0;

}