Question: write a program that reads positive numbers from the user and stores them in a list. The sentinel value is any negative number. next, process
write a program that reads positive numbers from the user and stores them in a list. The sentinel value is any negative number. next, process the list and print a) the number ofeven ints in the given list. Note: the %"mod" operator computes the remainder, e.g. 5 % 2 is 1. Example1, enter number and -1 to end: 2 enter number and-1 to end: 1 enter numberand-1 to end: 2 enter numberand-1 to end: 3 enter number and-1 to end: 4 enter number and-1 to end:-1 Total even numbers: 3 Example2 enter numbers and -1 to end: 1 enter number and-1 to end: 3 T enter number and-1 to end: 5 enter numberand-1 to end: -1 Total even numbers: 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
