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

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!