Recent changes Random page
GAMING
Technology
 
Gaming
Entertainment
Science Fiction
Biggest wikis
Hobbies
Music
See more...

Do while loop

From Programmer's Wiki

Jump to: navigation, search
 

A Do-While loop is a loop that executes at least once and will only terminate when the conditional statement returns false. Do-While loops are not as popular as the While loop. This is because the programmer must guarantee that any references inside the loop that depend on the conditional statement being true are usable before the conditional statement is checked. The Do-While loop is often used when there is some preparation needed before entering the loop.


[edit] C like languages

int x = 0;
int y = 10;

  do{
    x++;
  }while(x > y);
Rate this article:
Share this article: