Why wont this break

Ctrackstar126

Senior member
Jul 14, 2005
988
0
76
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)