166k views
3 votes
Draw a simple flowchart and write the pseudocode to represent the logic for a program that allows a user to enter 10 numbers,then displays them in reverse order of entry.

1 Answer

6 votes
This is best accomplished using a stack. I'm sure you can draw the flowchart yourself:

stack s
counter=10
while counter>0
read user input n
push n on s
decrease counter

counter = 10
while counter>0
pop n from s
display n
decrease counter

User Sam Coles
by
8.7k points