Question: Develop a C# console appliation that asks the user to enter an unspecified number of int inputs and then displays a message stating the number
Develop a C# console appliation that asks the user to enter an unspecified number of int inputs and then displays a message stating the number of inputs received and showing the odd values in one output line and then the even values in one output line (as shown).
The application must input the values from the keyboard using the private static method IEnumerable
Use an IEnumerable filter to filter the sequence for the odd values and then another IEnumerable filter to filter the sequence for the even values. Use the query body syntax ( from where select ) and assign the delayed execution sequence of each to a variable. E.g.
IEnumerable
and then use a foreach to interate through the odd numbers sequence and display the values to the console. E.g.
foreach(int oddNumber in oddNumbers)
and another foreach to iterate through the even numbers sequence and display the values to the console.
The input and output should look something like:
Please enter an int value. Press ENTER alone to quit: 55 Please enter an int value. Press ENTER alone to quit: 18 Please enter an int value. Press ENTER alone to quit: 47 Please enter an int value. Press ENTER alone to quit: 33 Please enter an int value. Press ENTER alone to quit: 106 Please enter an int value. Press ENTER alone to quit: 17 Please enter an int value. Press ENTER alone to quit: 12 Please enter an int value. Press ENTER alone to quit: 99 Please enter an int value. Press ENTER alone to quit: You have entered 8 values. The odd values are: 55 47 33 17 99 The even values are: 18 106 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
