2/15/00
COM1100 Winter2000 Yuhong Yin
9
Example 4 : while and do-while
nQuestion: ask user to guess a number 10 time. Each time if the number is great than 25, then print out “You lose !” and stop the loop immediately. Otherwise, print out “Keep entering” and continue the loop.
nSolution 1: Please use while statement.
nSolution 2: Please use do-while statement.
n