Given an integer and we have to find its reverse array.
For example we have an array arr1 which contains 5 elements: 12 14 11 8 23
And we create a temporary array named arr2 with same size. As we know that using Length property we can find length of array. So that we assign last element of arr1 to first position of arr2 and then decrement counter till 0th position. That’s why finally reverse array will be arr2.
After this process:
Arr1: 12 14 11 8 23
Arr2: 23 8 11 14 12
Consider the example:
Output