Question: Write a do-while loop that reads multiple integers from the user and multiplies them. The sentinel is 0. Negative values should be ignored. Print an
Write a do-while loop that reads multiple integers from the user and multiplies them. The sentinel is 0. Negative values should be ignored. Print an error message for negative value, but not for the sentinel as in the sample below.If the user enters the sentinel immediately, the program should recognize that no data was entered, as in the second sample output. In C Programming!
Enter integer: 4 Enter integer: 3 Enter integer -6 Invalid input! Enter integer: 0 The product is 12. Enter integer: 0 No data was entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
