#include "stdstuff.h" int main () { const int MAXVALUES = 100, TERMINATOR = -1; int data [MAXVALUES], count, value, i; cout << "\nEnter up to " << MAXVALUES << " values followed by " << TERMINATOR << ": "; count = 0; for (;;) { cin >> value; if (value == TERMINATOR) { // the input process is complete break; } if (count == MAXVALUES) { // the array is full cout << "\nToo many values entered.\n"; pause(); return 0; } data[count] = value; count++; } if (count == 0) { cout << "\nNo values were entered.\n"; } else { cout << "\nThe values in reverse order are:\n"; for (i = count - 1; i >= 0; i--) { cout << " " << data[i] << endl; } } pause(); return 0; }