Instructions:
- Input a positive integer. This will serve as the starting point of the loop.
- Using a while() loop, print out all the odd numbers starting from the inputted integer, until 0. The outputted numbers must all be separated by line.
- Also remember that since the loop goes to descending order, a decrement variable shall be created and decreased per iteration for the loop to terminate when it reaches 0.
Instructions
- Scan an integer that will accept an integer greater than 0 and store it in a variable.
- Using a while() loop, print out all the odd numbers starting from the inputted integer, until 0. The outputted numbers must all be separated by line, just like that of the sample output.
- Also remember that since the loop goes to descending order, a decrement variable shall be created and decreased per iteration for the loop to terminate when it reaches 0.
Input
A line containing an integer.
10
Output
Multiple lines containing an integer.
9
7
5
3
1
Comments
Leave a comment