Total Pageviews

February 15, 2012

Difference between WHILE …DO & REPEAT…….UNTIL Loop Structure


  WHILE …DO                

1.   The condition is tested before the body is executed.
2.   It is possible that the body may never be executed.(this occurs if the condition is true on the first test)
3.   The loop is exited when the condition is false.

REPEAT…….UNTIL
1.      The condition is tested after the body is executed.
2.      The body is always executed at least once.
3.      The loop is exited when the condition is true.


5 comments: