My homework is asking me to list two array into two columns, I was able to get the program to list the two arrays into the two columns but I don't know how to make the second column look nice.
This is my code.
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
cout << "There are 1000 cars in a lot, I will give you a list of the colors and how many cars there are of that color. \n";
cout << "Colors of cars: Numbers of cars:" << endl;
for (int i=0; i<10; i++)
{
cout << cars[i] << " " << number[i] << endl;
}
You could use the io manipulator setw() to set the width of your columns. I assume that was what you meant.
Check out iomanip under the input/output reference of this site. You have already included the relevant header.