Question: *****************************CODE SHOULD BE WRITTEN IN C++************************ Write a function to reverse an array of integers starting from a given start index and a given end
*****************************CODE SHOULD BE WRITTEN IN C++************************
Write a function to reverse an array of integers starting from a given start index and a given end index. Note, the end index is inclusive. Add code to the given function below.
*********************FUNCTION TO BE USED***********************************************
#include "problem1.h"
void reverseArray(int arr[], int start, int end)
{
//written code
}
************************************EXAMPLE************************************************ int[] a = {1,2,3}; reverseArray(a, 0, 2); //The content of a should be {3,2,1}. int[] a = {1,2,3}; reverseArray(a, 0, 1); //The content of a should be {2,1,3}. Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
