Check out example codes for "print array elements with space c++". It will help you in understanding the concepts better.

Code Example 1

#include <iostream> // cout
#include <iomanip> // setw
int main()
{
    int array[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };       
    for (auto n : array)
    {
        std::cout << std::setw(4) << n;
    }
}

Code Example 2

const int n = 10;
int array[n] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
for (int i=0;i<n;i++)
    printf("%4d",array[i]);

Learn ReactJs, React Native from akashmittal.com