[Univ of Cambridge] [Dept of Engineering]
next up previous contents
Next: for Up: Loops Previous: Loops

while, do

...
while(i<30){    // test at top of loop
  something();
...
}

...
do {
   something();
} while (i<30); // test at bottom of loop
...



Tim Love
2001-07-05