write the sum of two matric
Answers
Answered by
1
Your Question should be what is the sum of two matrix?
Answered by
0
Hope it helps!
Mark me as Brainlist!
Sum of two matrices in c programming
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int mat1[2][3],mat2[2][3],mat3[2][3],i,j;
printf("Enter the elements of matrix1\n");
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&mat1[i][j]);
}
}
printf("the elements of the matrix2\n");
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&mat2[i][j]);
}
}
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
mat3[i][j]=mat1[i][j]+mat2[i][j];
}
}
printf("\nthe result of matrix is\n");
for(i=0;i<2;i++)
{
for(j=0;j<3;j++)
{
printf(" %d",mat3[i][j]);
}
printf("\n");
}
getchar();
}
Similar questions
CBSE BOARD XII,
6 months ago
Math,
6 months ago
Math,
1 year ago
English,
1 year ago
Math,
1 year ago