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 and until the
user enters 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:
Number of odd integers:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
