Problem with do...while

I want to input only values between 2 - 7 what is wrong?

do{
cout<<"Podaj wykladnik\n";
cin>>b;
}while(b<=2 && b>=7);
Think about it. What value of b can be less than or equal to 2 and, at the same time, be greater than or equal to 7?
closed account (jh5jz8AR)
Hey Robsonmg,
b <= 2 ( b is less than or equal to 2)

and

b >= 7 (b is greater than or equal to 7)

take a look at these two pieces of code and you should realize the error that we have all made from time to time.
Topic archived. No new replies allowed.