Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
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 community
Anybody can ask a question
The best answers are voted up and rise to the top
On the screenshot is the result after I typed a negative integer. How do I ignore the negative integers on bottles' result? Help pls.
The positive & zero results are just fine, but the negatives are not finishing the do-while loop to prompt the user another digits for minutes. What is wrong here please?
asked Jun 22, 2017 at 13:25
333 bronze badges
The idea is to use a DO-WHILE loop as you do in your program but we will use it when ordering an integer with the function get_int():
printf("Enter an integer"
minutes = get_int()
while(minutes < 0)
The loop will be repeated while minutes are less than zero, the rest of the program should not go inside a loop
answered Jun 22, 2017 at 18:40
5,20133 gold badges1313 silver badges2323 bronze badges
You must log in to answer this question.
Not the answer you're looking for? Browse other questions tagged