**************sorted array

all test cases are not passing
#include
using namespace std;
bool IsSorted(long long int a[],int n){
if(n==1){
return true;
}

if(a[0]<a[1] && IsSorted(a+1,n-1)){
	return true;
} 
return false;

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

return 0;

}

@ayu2321 check for equality too since equal elements are also considered as sorted.