Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program called Sequence to produce a sequence of odd numbers counting down from a number entered by the user and finishing at 1.
Write a program called Sequence to produce a sequence of odd numbers counting down from a number entered by the user and finishing at 1.
REQUIREMENTS
- The user input is always correct (input verification is not required).
- Your code must use recursion.
- Your code must work exactly like the following example (the text in bold indicates the user input). Example of the program output(the text in bold indicates the user input):
Example 1: Please input a positive odd number: 5
Your sequence is: 5 3 1
Example 2:
Please input a positive odd number: 11
Your sequence is: 11 9 7 5 3 1
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