While loop
1. In 'while' loop the controlling condition appears at the start of the loop.
2. The iterations do not occur if, the condition at the first iteration, appears false.
3. It is an entry controlled loop
4. while(condition) {
body
}
do-while loop
1. In 'do-while' loop the controlling condition appears at the end of the loop.
2. The iteration occurs at least once even if the condition is false at the first iteration.
3. It is an exit controlled loop
4. do {
body
}while(condition);
0 Comments