Write a program to input a series of 12 integers from the keyboard and store them in a one-dimensional array, x[12], then displayed them on the computer screen in reverse order.
I have a basic understanding that:
My numbers in the array will go from {0 to 11}
I am using a for loop (which I don’t currently know how to do)
Now… How do I write this program?
You would do this:
for(size_t i = 0; i < 12; i++))std::cin >> array[i];To print them out you can use a while loop with i–. It will stop when i is zero and it will be backwards.
Because this is a homework question, I won’t give you the full code but I hope this answer helps.