Computer Science, asked by pavanacharya924, 4 months ago

write a c++ code that reads A&B matrix both and print A&B matrix both.

Answers

Answered by SreeRam99
1

Answer:

see below code

Explanation:

#include<iostream>

using namespace std;

int main()

{

int n,m,i,j;

cout<<"read size of m and n:";

cin>>m>>n;

cout<<"Enter elemets of the matrix:";

int a[m][n],b[m][n] ;

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

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

cin>>a[i][j];

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

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

cin>>b[i][j];

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

{

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

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

cout<<"n";

}

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

{

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

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

cout<<"n";

}

}


pavanacharya924: Tq
Similar questions