#include<stdio.h> #include<conio.h> int main() { int mat1[3][3], mat2[3][3], i, j, mat3[3][3]; printf("Enter Elements for Matrix 1 :"); for(i=0; i<3; i++) { for(j=0; j<3; j++) scanf("%d",&mat1[i][j]); } printf("Enter Elements for Matrix 2 :"); for(i=0; i<3; i++) { for(j=0; j<3; j++) scanf("%d",&mat2[i][j]); } for(i=0; i<3; i++) { for(j=0; j<3; j++) mat3[i][j]=mat1[i][j]+mat2[i][j]; } printf("\nADDTION MATRIX\n"); for(i=0; i<3; i++) { for(j=0; j<3; j++) printf("%d ",mat3[i][j]); printf("\n"); } getch(); return 0; }
C Program to Add Two Matrix.
Reviewed by
on
December 25, 2019
Rating:
No comments: