Why the program does not go to the if condition . it always enter the else condition

#include
#include
using namespace std;
int main() {int number1=-10000;
int n;
int i=0;
for( i=0;i<n;i++){
int number;
cin>>number;
if(number>number1){
number1=number;
continue;
}
else{
cout<<“false”;
break;
}
}
if(i==n){
cout<<“true”;
}

return 0;

}

The variable n is uninitialized, leading to undefined behavior in the for loop. Initialize n properly.

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.

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.