• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Why wont this break

Ctrackstar126

Senior member
do{
cout<<"Enter ID for student "<<i<<": ";
cin >>a;
if(a==-1){
break;

}
if(a<1000||a>9999){
cout<<"Invalid ID! Please enter a ID between 1000 and 9999. "<<endl;
}
}while(a<1000||a>9999);


It is not allowing me to break if I input -1 it is actually taking it as input.
(I couldnt post it with the attach code button sorry)
 
Back
Top