Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C# Program Console Program with Iterative Statements that does the following: Choose to write your program with only 1 of the 3 choices

Write a C# Program Console Program with Iterative Statements that does the following:

Choose to write your program with only 1 of the 3 choices of Iterative Statements: While, For, or Do While (Just choose 1)

Ask the user to enter an integer value between 2 and 10.

Write a test to determine if the user entered an even number or an odd number.

If the user entered an even number, then calculate the next higher number (which would an odd number) and print the statement "You entered an even number" that many times. For example, if user entered 4, then print this statement 5 times: "You entered an even number". Your Console output should look like this:

If the user entered an odd number, then calculate the next lower number (which would be an even number) and print the statement "You entered an odd number" that many times. For example, if user entered 7, then print this statement 6 times: "You entered an odd number".

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_2

Step: 3

blur-text-image_3

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

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions