Test cases failed

#include
using namespace std;
void Inverse(int arr[],int n)
{
int other[n];
other[0]=arr[0];
int ans=1;
for(int i=n-1;i>=1;i–)
{
other[ans]=arr[i];
ans++;
}
for(int i=0;i<n;i++)
{
cout<<other[i]<<endl;
}

}

int main() {

int n;
cin>>n;
int arr[100];
for(int i=0;i<n;i++)
{
    cin>>arr[i];
}

Inverse(arr,n);

}

don’t confuse inverse with revers
reversing and inversing array are 2 different things
here you have to inverse, not reverse

Inverse is Simply swapping the value of the array with the value at that index.

Algo

  1. Create a new Array say narr and original array is arr.
  2. now at the arr[i]th index of narr save the ith value.(previously i is the index and arr[i] is the value bt now arr[i] is the index and i is the value.)
  3. return new array.

refer to this code

can you once check my code si

Yes I checked your code you are reversing the array but you have to inverse the array

@tarun1010
kindly give your feedback asap

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.