Question
Given an array of positive integers, reverse the entire list. You must physically rearrange the elements in the list, and not simply print the list
Given an array of positive integers, reverse the entire list. You must physically rearrange the elements in the list, and not simply print the list in reverse order. Your C++ program will need to read the list of up to 20 numbers from the keyboard, and store them into an array. The number -1 is used to signal the end of the list. Once the numbers have been stored in the array, your program should then proceed to rearrange the elements in the list. input: 9 0 2 1 8 -1\ output: 8 1 2 0 9 \ At the end of the program, the starter code will print your array out to the screen for verification.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started