Question: ***C++ CODE*** Write a function named, reverse, which reverses the order of an array's elements without creating another array. The header for the function, reverse,

***C++ CODE***  ***C++ CODE*** Write a function named, reverse, which reverses the order

Write a function named, reverse, which reverses the order of an array's elements without creating another array. The header for the function, reverse, is: void reverse ( int arr1, int len )I where arr is an array containing any number of integer elements and len is the number of elements in the array. For example, If the array is (6, 4, 9,1, 77 BEFORE calling reverse, then the array should be (7, 1, 9, 4, 6) AFTER calling reverse. Your code should work for any length of integer array containing any values. Your reverse function should not do any keyboard input and no printing to the console. Your submission should be called, FinalExam.cpp, and must also include a main function that tests the function, reverse. The main function may do console output, but does not need any keyboard input. Arrays created in main for use in testing the reverse function should be created using static initialization as in the example below. Here are FOUR tests you should run from the main function by calling the reverse function: 1. Pass an array with 10 elements and then verify the array elements are reversed upon returning from the function, reverse. Here is an example of doing this: II create the array to test int nyArray t0. 1. 2, 3, 4, 5, 6, 7. 8. 9 1 int nyArrayRev-9, 8, 7, 6, 5, 4, 3, 2. 1. 0 int arren 10 reverse(myArray for (inti-0: i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!