C++ Program to Initialize and Print Matrix
Write C++ Program to Initialize and Print Matrix
// CPP program to Initialize and Print Matrix #include <iostream> using namespace std; int main() { int A[3][3] = {{1, 2, 3}, {5, 6, 7}, {7, 8, 6}}; int i, j; cout << "The matrix is :--> \n"; for(i = 0; i < 3 ; i++) { for(j = 0; j < 3; j++) { cout << A[i][j] << " "; } cout << endl; } return 0; }
Output:
The matrix is :-->
1 2 3
5 6 7
7 8 6