+ 1

how to print all the number of the array

19th Dec 2016, 9:08 AM
BE THE BOSS
BE THE BOSS - avatar
2 Answers
+ 3
You could use a for loop: int arr[5] = {1, 2, 3, 4, 5}; for (int x=0;x<5;x++) { cout << arr[x] << endl; }
19th Dec 2016, 9:28 AM
Antek
0
int b[] = {10, 20, 30, 40, 50, 60} for(a=0; a<6; a++){ cout << b[a]; }
24th Dec 2016, 2:13 AM
Vivekanand Pandey
Vivekanand Pandey - avatar