Using the cout Object with Numeric Arrays : cout « Console « C++






Using the cout Object with Numeric Arrays

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;
}

           
       








Related examples in the same category

1.Call function in coutCall function in cout
2.Use function in coutUse function in cout
3.Unformattwd Input/Output: cin.get and getlineUnformattwd Input/Output: cin.get and getline