0

When I input 0 or 1 to the program, it works as expected ( outputs the value and takes another ) , but if I input anything else, an infinite loop keeps printing 1 1 1 1....

int main(){
    do{
        bool a;
        cin>>a;
        cout<<a<<endl;
    }
    while(true);
}

why did that happen ?

anonymous38653
  • 393
  • 4
  • 16

0 Answers0