Apr 13, 2011

Main difference between a Do While loop and a Do Until loop?

'do-while' loop completes steps as long as a certain condition is true. 

A 'do-until' loop does something until a condtion is no longer true.

In pseudocode examples, it would be like 

do print "OK" until variable = 10

do print "OK" while variable < 10

When I took Visual Basic, the instructor I had favored do until, so I do as well. I can't say one is better than the other since my opinion would be biased. 

Example of do while loop......                                                     do until loop......

Stumble
Delicious
Technorati
Twitter
Digg
Facebook
Yahoo
Feed

0 comments: