Mega Code Archive

 
Categories / C++ / Data Structure
 

Using the cin and cout Objects with Arrays

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