Possible to reverse numbers in an array?
I know it's possible to reverse numbers of a list, but is it possible to do it when using an array?
For an example here is a simple program that asks the user to enter the amount of numbers in the array, asks the users to enter the numbers in the array, and then prints them out.
Code:
#include<iostream>
using namespace std;
int main()
{
int SIZE;
int counter;
cout << "Enter the size of the array: ";
cin >> SIZE;
int number[SIZE];
for (counter = 0; counter < SIZE; counter++)
{
cout << "Enter number " << (counter + 1) << ": " ;
cin >> number[counter];
}
for (counter = 0; counter < SIZE; counter++)
{
cout << number[counter] << " ";
}
cout << endl;
return 0;
}
If I enter 1 2 3 4 5 in, is it possible with the code I have, to make the numbers come out 5 4 3 2 1?