Https://ide.codingblocks.com/s/51930

Take as input N, a number. Take N more inputs and store that in an array. Write a recursive function which inverses the array. Print the values of inverted array
Sample Input:

4
1
0
2
3

Sample Output:

1 0 2 3

Hey Astha, i guess you are not getting the meaning of inversing the array here, inversing an array is inserting position of an element at the position specified by the element value in the array.
for eg.
Input = {0, 3, 2, 1}
Output = {0, 3, 2, 1}
For element 1 we insert position of 0 from arr1 i.e 0 at position 1 in arr2. For element 3 in arr1, we insert 1 from arr1 at position 3 in arr2. Similarly, for element 1 in arr1, we insert position of 1 i.e 3 in arr2.

i have changed my code but still it is not passing one test case
https://ide.codingblocks.com/s/51930

Hey Astha, your code is correct but as the result you are supposed to print arr2 instead of arr1. So update your code’s line:18 as cout<<arr2[i]<<" ";