Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

Students also viewed these Databases questions

Question

How is Karen Slagles argument an example of confirmation bias?

Answered: 1 week ago

Question

2. What are the components of IT infrastructure?

Answered: 1 week ago