// Mr. Minich
// CMPSC 201
// Ch. 11 Demo Program #2
// January 20, 2000
// Purpose - to illustrate the use of arrays.
#include <iostream>
using namespace std; int main() { int gameScores[3] = {0};
// initializes each element of the array gameScores to zero
for (int i = 0; i <= 2; i++) { cout << "Enter the score of Game " << i + 1 << ": "; cin >> gameScores[i]; } // Notice that (i + 1) must be displayed to account for the // fact that the array begins with index position 0. cout << "Your average score was " << (gameScores[0] + gameScores[1] + gameScores[2]) / 3 << endl; return 0; }// end of main