do..while loop
The body of the loop will be executed first and then the condition is tested.
Syntax:
do{ text expression; // Body of loop }while(condition);
Example:
Dart
void main() { var w3wiki = 4; int i = 1; do { print( 'Hello Geek' ); i++; } while (i <= w3wiki); } |
Output:
Hello Geek Hello Geek Hello Geek Hello Geek
Dart – Loops
A looping statement in Dart or any other programming language is used to repeat a particular set of commands until certain conditions are not completed. There are different ways to do so. They are:
- for loop
- for… in loop
- for each loop
- while loop
- do-while loop
Contact Us