Life is easier if you do array access and the loop accessing its elements starting at element 0. If you want to show the user numbering starting at 1, do so in the display.
int i;
int arr[3] = { 0 };
for( i = 0; i < 3; i++ )
{
cout << "enter item #" << i+1 << " :";
cin >> arr[i];
}
To display all the data entered, on one line, with a label as you're trying to do, take the label out of the loop, just do the data output inside the loop.
cout << "Data values: ";
for( i = 0; i < 3; i++ )
cout << arr[i] << " ";
In your printresults( ) function, you'll need separate loops for each of the three score types.
vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228