pseudocode
Date: 10/18/07
(Algorithms) Keywords: no keywords
hey I was wondering if anyone could help me with this question,
Write a pseudocode algorithm to print the numbers from 1 to 10, and then from 10 to 1, using exactly one loop. (Try using an if statement inside the loop.)
so far I have this...
for ( i = 1; i <= 20; i ++)
print i
if ( i > 10)
i--
I know it's probobly wrong... especially the if part.
any suggestions?
Source: http://community.livejournal.com/algorithms/93297.html