Test case not passed

#include
using namespace std;
bool sorted(long int *arr , long int n)
{
if(n==1)
{
return true;

}
else if (arr[0]<arr[1] && sorted(arr+1,n-1))
{
	return true;
}
return false;

}
int main(){
long int n;
cin>>n;
long int arr[n];
for(long int i=0;i<n;i++)
{
cin>>arr[i];
}
if(sorted(arr,n)){
cout<<“true”<<endl;
}
else{
cout<<“false”<<endl;
}

return 0;

}


slight changes have been made.
your logic was correct

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.