Question: Write a program to do the following in c++: Ask the user for a beginning number between 1 and 100. If they enter a number
Write a program to do the following in c++:
-
Ask the user for a beginning number between 1 and 100. If they enter a number outside the range, let them correct it.
-
If the input number is ODD use that number. If it is not odd, add 1 to it.
Ask how many sequential ODD numbers they wish to see.
Your output should be:
Example: If the user enters 22 and asks for 5 numbers, your output should be 25 27 29 31 33
-
Allow the user to test many numbers until they tell you to stop.
-
Test as follows:
Enter the last 2 digits of your student ID and request sequential 7 numbers
Enter the last 2 digits of your student ID and request -3 numbers. Display error message.
Enter any number of your choosing as a third test
Paste the output as a comment to the bottom of your program. Copy the entire program and output. Go back to the Quiz and paste the answer to the essay question.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
