R9 found at last problem in running code

@jaiskid Not able to find what is wrong in logic. I want to start from last element for searching. When element foud return location of array. But the code is printing only -1

while taking input you have written cin>>arr[n] instead of cin>>arr[i];