Flow control: do loops
Form: do{STATMENT} while(CONDITION)
Unlike for and while, loop condition is tested at end of loop
STATEMENT will be executed while COND evaluates to TRUE
int i=0;
do {
y=y+i;
i=i+1;
}while(i);
do {
y=y+1;
}while(i);
Previous slide
Next slide
Back to first slide
View graphic version