+ 1

Int x[2][3] = {{1,2,3},{4,5,6}}; I want to print all the numbers included in 2D array how?

Using C++

9th Dec 2018, 2:16 PM
Saad Saleem
Saad Saleem - avatar
5 Answers
+ 7
for (int first = 0; first < 2; first++) { for (int second = 0; second < 3; second++) cout << x[first][second] << " "; cout << endl; }
9th Dec 2018, 4:09 PM
John Wells
John Wells - avatar
+ 2
It should already print that way, if you used my code.
10th Dec 2018, 4:02 PM
John Wells
John Wells - avatar
+ 1
Thanks sir.
9th Dec 2018, 6:13 PM
Saad Saleem
Saad Saleem - avatar
+ 1
Yes I know that now earlier I am not focus on endl and " " .
10th Dec 2018, 4:08 PM
Saad Saleem
Saad Saleem - avatar
0
I want to display number like that 1 2 3 4 5 6 How can I do?
10th Dec 2018, 9:28 AM
Saad Saleem
Saad Saleem - avatar