Code not working properly

Test Case2 is wrong and
Showing Wrong Output
But the code is right as taught.

#include
using namespace std;
bool isSorted(int *a,int n)
{
if(n==1)
{
return true;
}
else if(a[0]<a[1] && isSorted(a+1,n-1))
{
return true;
}
else{
return false;
}
}
int main() {
int n;
cin>>n;
int *arr=new int[n];
for(int i=0;i<n;i++)
{
arr[i];
}
if(isSorted(arr,n)==true)
{
cout<<“true”;
}
else{
cout<<“false”;
}
}

@vasugoel0240
hello vasu,
please save ur code on-> https://ide.codingblocks.com/ and share the link

@vasugoel0240

it shoulde be <=

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.