A C Program of Sum of Two Matrix

// A C Program of Sum of Two Matrix

#include<stdio.h> 
#include<conio.h>
void main() 

int a[2][2],b[2][2],c[2][2],i,j; 
clrscr(); 
printf("Enter the value of First 2 x 2 Matrix :a "); 
for(i=0;i<2;i++) 

for(j=0;j<2;j++) 

printf("Enter the element of [%d][%d]",i,j);  
scanf("%d",&a[i][j]);


printf("Enter the value of Second 2 x 2 Matrix :b "); 
for(i=0;i<2;i++) 

for(j=0;j<2;j++) 
{
printf("Enter the element of [%d][%d]",i,j);
scanf("%d",&b[i][j]); 


for(i=0;i<2;i++) 

for(j=0;j<2;j++) 

c[i][j]=a[i][j]+b[i][j];
}
}
for(i=0;i<2;i++) 

for(j=0;j<2;j++) 

printf(" %d\t",c[i][j]); 

printf("\n");

getch(); 
}

Output:


A C Program of Sum of Two Matrix, matrix example, matrix, c program matrix, my knowledge to you dude


Post a Comment

0 Comments