Wisdom Materials
Home
About Us
Our Clients
Careers
Services
Education
Jobs
News
Business
Health
Astrology
Entertainment
RealEstate
Devotion
Contact Us
C Programs
/ Matrices Substraction using Arrays C program
Program Name
Write a C Program for Matrices Substraction using Arrays.
Theory
We add one matrix to other Matrix.
Program Code
Copy Program Code
#include
int main() { int a[10][10],b[10][10],c[10][10],i,j; printf("Enter Matrix A Values"); for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%d",&a[i][j]); printf("Enter Matrix B Values"); for(i=0;i<3;i++) for(j=0;j<3;j++) scanf("%d",&b[i][j]); printf("The Resutltant Matrix C is\n"); for(i=0;i<3;i++) { for(j=0;j<3;j++) { c[i][j]=a[i][j]-b[i][j]; printf("%d ",c[i][j]); } printf("\n"); } return 0; }
Input
Enter Matrix A Values1 2 3 4 5 6 7 8 9
Enter Matrix B Values1 2 3 4 5 6 7 8 9
Output
The Resutltant Matrix C is
2 4 6
8 10 12
14 16 18
Online C Compiler (To copy paste and Run the c program)
Home
Back