Question: Q2 (20 pts). Write a C++ function named arrange that accepts an integer array, and its capacity, and returns an integer pointer that stores the

 Q2 (20 pts). Write a C++ function named arrange that accepts

Q2 (20 pts). Write a C++ function named arrange that accepts an integer array, and its capacity, and returns an integer pointer that stores the address of a new array which contains the same array elements in the following order: all odd numbers in reverse order, and all even numbers in reverse order. Therefore, you should create a new array in the function having the same size as the array in the parameter and copy all elements in the requested order. For instance, 422 6". int a[]={3,7,13,12,6,4} int b= arrange (a,6); for (int i=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!