Mega Code Archive

 
Categories / C++ / Console
 

Using the cout Object with Numeric Arrays

#include <iostream> using namespace std; const int MAX = 3; int main () {    int testScore[MAX];    for (int i = 0; i < MAX; i++)    {       cout << "Enter test score #" << i + 1 << ": ";       cin >> testScore[i];    }    cout << "The test scores are: " << testScore;    return 0; }