Question: While loops Write a program that reads in a sequence of integer inputs between 1 and 1 0 0 until the user enters 0 (

While loops
Write a program that
reads in a sequence of integer inputs between 1 and 100 until the
user enters 0(use a while loop).
After the loop, print the counts of even and odd integers the user
entered.
Hint:
In the loop, check if the number inputted is even,
if so, increment a variable that holds the count of even numbers
Otherwise, the number inputted must be odd
so increment a variable that holds the count of odd numbers
Sample run of program:
Enter a number:Enter a number:Enter a number:Enter a number:Enter a number:Enter a number:Number of even integers: 2
Number of odd integers: 3
While loops Write a program that reads in a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!