Write a c program to find the sum of two matrices. The elements (integers) of these two matrices will be provided by the user.
Answers
Answered by
0
Answer:
upchucking hibiscus iconostasis
Answered by
0
Hope it helps!
Mark me as Brainlist!
Program: 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
Math,
5 months ago
India Languages,
5 months ago
English,
5 months ago
Computer Science,
9 months ago
Math,
9 months ago