I am having a problem with my do while loop.
do
{
//this thing
}
while (n < 0 && n > 23);
when I run it every time I enter a number ether valid or invalid it ends my program.
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.
Sign up to join this communityThis loop will run exactly once every time. Look at your test. It has to be true for the loop to execute more than once, but that will never happen. What number can be less than zero AND greater than 23 AT THE SAME TIME? ;-)
If this answers your question, please click on the check to accept. Let's keep up on forum housekeeping. ;-)