#include<stdio.h> #include<conio.h> void main() { clrscr(); int arr1[3][3], arr2[3][3], arr3[3][3], sub, i, j; printf("Enter elements for Matrix 1 : "); for(i=0; i<3; i++) { for(j=0; j<3; j++) { scanf("%d",&arr1[i][j]); } } printf("Enter Elements for Matrix 2 : "); for(i=0; i<3; i++) { for(j=0; j<3; j++) { scanf("%d",&arr2[i][j]); } } for(i=0; i<3; i++) { for(j=0; j<3; j++) { arr3[i][j]=arr1[i][j]-arr2[i][j]; } } printf("SUBTRACTION MATRIX :\n"); for(i=0; i<3; i++) { for(j=0; j<3; j++) { printf("%d ", arr3[i][j]); } printf("\n"); } getch(); }
C Program to Subtract Two Matrix.
Reviewed by
on
December 25, 2019
Rating:
No comments: