Computer Science, asked by Nehasri3566, 11 months ago

Ashok is a ninth-grade schoolboy. Miss Sumaiya is a very strict teacher and she teaches math to all the students. On the first day of the academic year, Miss Sumaiya gave him homework to find the addition of two matrices. Can you help Ashok by writing a program for the same. Input Format: The first input contains an integer 'r' which denotes the number of rows The second input contains an integer 'c' which denotes the number of columns The remaining input denotes the inputs of matrix1 and matrix2

Answers

Answered by deepalibhargava32
2

Answer:

40

Explanation:

rt

Answered by distun2ps
10

Answer:all cases satisfied

Explanation:

#include<iostream>

using namespace std;

int main()

{

int rows, cols, m1[10][10], m2[10][10], sum[10][10];

cin>>rows;

cin>>cols;

for (int i = 0;i<rows;i++ ) {

for (int j = 0;j < cols;j++ ) {

cin>>m1[i][j];

}

}

for (int i = 0;i<rows;i++ ) {

for (int j = 0;j<cols;j++ ) {

cin>>m2[i][j];

}

}

for (int i = 0;i<rows;i++ ) {

for (int j = 0;j<cols;j++ ) {

sum[i][j]=m1[i][j]+m2[i][j];

cout<<sum[i][j]<<" ";

}

 cout<<"\n";

}

return 0;

}

Similar questions