Question: C++ Please You need to write a function named reverse. The function is described below: reverse: takes an array of integers and its size as
C++ Please
You need to write a function named reverse. The function is described below: reverse: takes an array of integers and its size as arguments. It reverses the array in place so that the elements are in reverse order. This can be done by swapping the first and last elements, second and second-to-last elements, and so on. Do not use square brackets [ ] anywhere in the function, not even the parameter list (use pointers instead). Use the main function to demonstrate your function (you may use square brackets in the main function). Assume the input will be a sequence of numbers, the first number will be a count of how many numbers follow. Input the values into the array and call reverse on it. In main it should output the values of the array after the call to the function. Ex: If the input to the program is: 812345678 the output is: 87654321 If the input to the program is: 51243 the output is: 53421 Your program must define and call a function named reverse with two parameters in the order described above, that returns void
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
