Do While Loop

In most computer programming languages, a do while loop, sometimes just called a while loop, is a control flow statement that allows code to be executed once based on a given Boolean condition. Note though that unlike most languages, Fortran's do loop is actually the same to the for loop.

The do while construct consists of a process symbol and a condition. First, the code within the block is executed, and then the condition is evaluated. If the condition is true the code within the block is executed again. This repeats until the condition becomes false. Because do while loops check the condition after the block is executed, the control structure is often also known as a post-test loop. Contrast with the while loop, which tests the condition before the code within the block is executed.

It is possible, and in some cases desirable, for the condition to always evaluate to true, creating an infinite loop. When such a loop is created intentionally, there is usually another control structure (such as a break statement) that allows termination of the loop.

Some languages may use a different naming convention for this type of loop. For example, the Pascal language has a "repeat until" loop, which continues to run until the control expression is true (and then terminates) — whereas a "while" loop runs while the control expression is true (and terminates once the expression becomes false). Bash did not support this control flow statement.

Read more about Do While Loop:  Equivalent Constructs, Demonstrating Do While Loops

Other articles related to "loop, do while loop, loops":

Loop - Other Uses
... Loop (biochemistry), a flexible region in a protein's secondary structure Loop (education), the process of advancing an elementary school teacher with his or her ...
Kumba (roller Coaster)
... by B M, and featured B M's first ever diving loop and interlocking corkscrews ... It has seven inversions which, in order, are A 114-foot-tall (35 m) vertical loop, which wraps around the lift hill B M's first-ever diving loop Zero-G roll Cobra roll (two inversions that go ...
Demonstrating Do While Loops - Racket
... In Racket, as in other Scheme implementations, a "named-let" is a popular way to implement loops #lang racket (define counter 5) (define factorial 1) (let loop (set ...
Woodlands Regional Bus Interchange - Bus Services
... B7 Ang Mo Kio 178 B12 Boon Lay 187 B16 Boon Lay 856 B11 Yishun 858 B4 Changi Airport (loop) 925 B11 Choa Chu Kang/Neo Tiew Crescent (loop) 950 B14 Kotaraya 960 ... B16 ...