Write a function to read a matrix m*n from the keyboard
Answers
Answered by
0
Function
Explanation:
A C++ function to read a matrix m*n from the keyboard
int main()
{
int a[5][5],n,m,i,j;
c<<"Enter value of m and n:";
cin>>m>>n;
c<<"nEnter elemets of the matrix:n programology content";
for(i=0;i<m;++i)
for(j=0;j<n;++j)
cin>>a[i][j];
c<<"nThe Matrix is:n";
for(i=0;i<m;++i)
{
for(j=0;j<n;++j)
c<<a[i][j]<<" ";
c<<"n";
}
return 0;
}
Similar questions