print space in array cpp

Solutions on MaxInterview for print space in array cpp by the best coders in the world

showing results for - "print space in array cpp"
Isabelle
09 Aug 2017
1#include <iostream> // cout
2#include <iomanip> // setw
3int main()
4{
5    int array[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };       
6    for (auto n : array)
7    {
8        std::cout << std::setw(4) << n;
9    }
10}
11
Ange
29 Sep 2018
1cout << array << " ";
Shana
17 Aug 2018
1const int n = 10;
2int array[n] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
3for (int i=0;i<n;i++)
4    printf("%4d",array[i]);
5
similar questions
queries leading to this page
print space in array cpp