write a c++ code that reads A&B matrix both and print A&B matrix both.
Answers
Answered by
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
Political Science,
2 months ago
Hindi,
2 months ago
Environmental Sciences,
2 months ago
Math,
4 months ago
Math,
10 months ago