Please help me with a simple algorithm using a while loop

jb82's Avatar, Join Date: May 2007
Newbie Member
set the initial value of count to 10
while (NOT (count is 0) )
write the value of count in the output window
decrease count by 1
move to the next line of the output window
write 'zero' in the output window

(a) what will be written to the output window when this algorithm is run?
(b) Suppose the second line of the algorithm were changed to read
while (count is 11)
What will be written when the modified algorithm is run?

How do I get the answers?
Many thanks jb82
0
abhishekshahi's Avatar, Join Date: Jun 2007
Newbie Member
Hi,

1)

10
9
8
7
6
5
4
3
2
1
Zero

2)

11
10
9
8
7
6
5
4
3
2
1
Zero

Do i have answered your question ?