Question
USE C# 5.0 MAKE SURE THERE ARE NO ERROR SO THE PROGRAM RUNS Write a program to count the number of even and odd numbers
USE C# 5.0 MAKE SURE THERE ARE NO ERROR SO THE PROGRAM RUNS
Write a program to count the number of even and odd numbers from a series of numbers whose starting and ending number is provided by the user.
The starting number must be less than the ending number. The program should continue asking the user for a valid ending number until it is larger than the starting number.
The range is inclusive -- the starting and ending numbers should be tested and counted as part of the series.
Sample Program Runs
After your program runs, the console should look like the following examples. The exact output will vary depending on what the user inputs.
Starting number: 2 Ending number: 10 There were 5 even numbers There were 4 odd numbers
Starting number: 5 Ending number: 4 Ending number must be greater than starting number! Ending number: 5 Ending number must be greater than starting number! Ending number: 6 There were 1 even numbers There were 1 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