Horje
how creat matrix column in c++ Code Example
how creat matrix column in c++
#include <iostream>

using namespace std;

template <int rows, int cols>
void display(int (&array)[rows][cols]) {
  int i, j;
  cout<<"\n";
  for(i = 0; i<rows; i++) {
      for(j = 0; j<cols; j++) {
        cout<<" ";
        cout<<array[i][j];
      }
      cout<<"\n";
    }
}


int main() {
  int M1[3][3];
  cout<<"Enter your matrix elements: \n";
  int i, j;
    for(i = 0; i<3; i++) {
      for(j = 0; j<3; j++) {
        cout<<"a["<<i<<"]["<<j<<"]: ";
        cin>>M1[i][j];
      }
    }
    display(M1);
  return 0;
}




Cpp

Related
C++ thread id Code Example C++ thread id Code Example
c++ code to c code converter Code Example c++ code to c code converter Code Example
avl tree c++ Code Example avl tree c++ Code Example
c++ add object to array Code Example c++ add object to array Code Example
array copx c++ Code Example array copx c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9