Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
Use a range-based for loop(printing an array is a basic I don't think you even need to practice it). std::array<int,5> arr = {1,2,3,4,5}; // std::array is the "real" array in C++, not arr[size] for(int i : arr) std::cout << i << ' ';
21st Apr 2021, 7:26 PM
Maher Al Dayekh
Maher Al Dayekh - avatar
0
Post the code here
21st Apr 2021, 6:13 PM
Atul [Inactive]
0
Make a for loop to go through the range of the index and cout each value. for ( index = 0; index < 5; index++) cout << arr[index] << endl;
21st Apr 2021, 6:15 PM
Jerry Hobby
Jerry Hobby - avatar