What is the error in this code

#include
using namespace std;
int main() {
int n,no,t=0,i,y=0;
cin>>n;
for(i=0;i<n;i++)
{
cin>>no;
if(t>no)
{
t=no;
break;
}
t=no;
}
for(i;i<n;i++)
{
cin>>no;
if(t<no)
{
cout<<“false”;
return 0;
break;
}
t=no;
}
cout<<“true”;
return 0;
}

Hey @Adityakumar3112
It’ll give wrong answer for test case [ 1, 1]

can you give me test case 8

Sorry buddy I can’t give you the test case. You can check this out instead and see whats wrong.

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.

@Adityakumar3112 Is your doubt resolved?

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.