Question: Write an algorithm (using pseudocode) that takes as input an integer n and prints out the integers from n to 1 in descending order if
- Write an algorithm (using pseudocode) that takes as input an integer n and prints out the integers from n to 1 in descending order if n is positive and prints out an error message if n is zero or negative. Draw a flowchart that represents the algorithm.
Hint: You will need both a selection and an iterative structure.
Important: Students often think they need a list to solve this problem; a list is not required. While it can be solved with a list the solution becomes overcomplicated.
Identify the different control structure elements Sequential, Conditional, Iterative in your flow chart, by using different colours or some other means be creative
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
