Jump to content

information on how to write pseudocode in decreasing order.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
dav4life

dav4life

    Newbie

  • Members
  • Pip
  • 2 posts
I understand getting the logic to go from 1 to 10 but I can not understand 10 to 1. Any help would be great.

??????Design the logic for a program that prints numbers in reverse order from 10 down to 1.

#2
abzero

abzero

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 217 posts
erm,

 let x = 10

 while (x > 0)

     print x

     let x = x -1

 end while

??

#3
dav4life

dav4life

    Newbie

  • Members
  • Pip
  • 2 posts
just to let you know I am very basic here so if I ask a question and it may be stupid, just bare with me. The erm, couldn't I also name it num? And my flowchart would show this cycle because x > 0

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
I would rephrase that last sentence. Was there a question in there?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
krwq

krwq

    Newbie

  • Members
  • PipPip
  • 28 posts
for x=10 downto 1 do
print x;