Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that prompts the user to enter four integer numbers and then count the odd and even numbers in the entries. A sample
Write a program that prompts the user to enter four integer numbers and then count the odd and even numbers in the entries. A sample run: Enter an integer number: 2 Enter an integer number: 7 Enter an integer number: 4 Enter an integer number: 6 Number of even numbers entered: 3 Number of odd numbers entered: 1 Step 1: The question ask you to get Four integer numbers from user, you need a FOR loop to do that and range of that loop should be 4 Step 2: Before you start the FOR loop, you will need two counters, one for the even numbers and one for the odd numbers and initial value should be 0 Step 3: Inside the FOR loop, you need to determine the number is odd or even. (see [Assignment 21 Question 02: how to determine odd/even number?) Step 4: Inside the FOR loop, increment the counter respectively for odd and even numbers. Step 5: Display the final results for the counts of even and odd numbers
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started