You are here

Iteration (Repetition) Control Structures

6 February, 2015 - 12:29

Example 10.5: pseudocode: While

count assigned zeroWhile count  < 5  Display "I love computers!"  Increment countEndwhile

Example 10.6: pseudocode: For

For x starts at 0, x < 5, increment x  Display "Are we having fun?"Endfor

Example 10.7: pseudocode: Do While

count assigned fiveDo  Display "Blast off is soon!"  Decrement countWhile count > zero

Example 10.8: pseudocode: Repeat Until

count assigned fiveRepeat  Display "Blast off is soon!"  Decrement countUntil count  < one