2d Arrays & Nested Loops

Lesson 25
Author : Afrixi
Last Updated : November, 2017


Table of Content

Code

Copy// int  numberGrid[2][3];
int numberGrid[2][3] = { {1, 2, 3}, {4, 5, 6} };

numberGrid[0][1] = 99;
cout << numberGrid[0][0] << endl;
cout << numberGrid[0][1] << endl;

for(int i = 0; i < 2; i++){
     for(int j = 0; j < 3; j++){
          printf("%d", numberGrid[i][j]);
     }
}