how to print an array with spaces in cpp code example
Example 1: print space in array cpp
cout << array << " ";
Example 2: print array elements with space c++
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]);