#include #include using namespace std; int main() { const size_t n {10}; //number of elements in the array int a[n] {}; //born holding n zeroes. //Normally we would prompt the user at this point. for (int i {0}; i < n; ++i) { cin >> a[i]; if (!cin) { cerr << "Could not input value #" << i << ".\n"; return EXIT_FAILURE; } } //Output the values in reverse order. for (int i {n-1}; i >= 0; --i) { cout << a[i] << "\n"; } return EXIT_SUCCESS; }