- Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path2darray.cpp
More file actions
Latest commit
25 lines (23 loc) · 556 Bytes
/
Copy path2darray.cpp
File metadata and controls
25 lines (23 loc) · 556 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
usingnamespacestd;
intmain(){
// This is ho wa 2-D arrays look like cin c++
// We can use the same to create a multi dimensional array
int numgrid[6][4] = {
{1,2,3,4},
{5,6,7,8},
{1,2,3,4},
{5,6,7,8},
{1,2,3,4},
{5,6,7,8}
};
cout<<numgrid[1][1];
// This is a example of neted for loop
for(int i=0; i<6; i++){
for(int j=0; j<4; j++){
cout<<numgrid[i][j]<<"\t";
}
cout<<"\n";
}
return0;
}