Term of the Moment

ethical hacker


Look Up Another Term


Redirected from: while loop

Definition: do loop


A high-level programming language structure that repeats instructions based on the results of a comparison. In a DO WHILE loop, the instructions within the loop are performed if the comparison is true. In a DO UNTIL loop, the instructions are bypassed if the comparison is true. The following simulated DO WHILE loop prints 1 through 10 and stops. The bold words are programming commands, and the others are variables created by the programmer. See variable and loop.

   counter = 0
   do while counter < 10
     counter = counter + 1
     print counter
   enddo