#include <iostream>
using namespace std;
int main() {
int test[3][2] =
{{2, -5},
{4, 0},
{9, 1}};
// use of nested
for loop
// access rows of
the array
for (int i = 0; i
< 3; ++i) {
// access
columns of the array
for (int j =
0; j < 2; ++j) {
cout
<< "test[" << i << "][" << j
<< "] = " << test[i][j] << endl;
}
}
return 0;
}
output :
test[0][0] = 2
test[0][1] = -5
test[1][0] = 4
test[1][1] = 0
test[2][0] = 9
test[2][1] = 1
0 Comments