This is my code for the problem

#include
using namespace std;
int main() {
int n,flag2=1,flag=0,pos;
cin>>n;
int A[n];
for(int i=0;i<n;i++){
cin>>A[i];
}
for(int i=0;i<n;i++){
if(A[i]<A[i+1]){
pos=i;
flag2=1;
break;
}
else
{
flag2=0;
}
}
if(flag2==1){
for(int j=pos;j<n-1;j++){
if(A[j]>A[j+1]){
flag=1;
break;
}
}
}
if(flag==0||flag2==0)
cout<<“true”;
else
cout<<“flase”;
return 0;
}

Hello @kabirsachin1999

Here is the modified code

I have marked the changes required.