-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path#11-Do_while.dart
More file actions
41 lines (25 loc) · 1.03 KB
/
#11-Do_while.dart
File metadata and controls
41 lines (25 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
void main() {
// <--------Loop Control Statement---------->
// Do while loop in dart\indefinite loop
//main loop structure
//intialize a varriable like var i = 1;
//Execute the main lopped code like some print statement
//increment varriable value by 1 in this statement i++
//Condition Check like i < 4
var i = 0; //initialize
do{
print(i);
i++;
}while(i<=10);
}
// How Do while loop Works internally
//flow of Do while loop
// initialize -> Code Execute -> Increment/decremnt-> Condition Check
/*
do(initializer; condition; increment/decrement){
Put maincode
}while(condition )
loop1 int i = 1 -> code execute -> i++ then -> i = 2 ->condition=true ->(continued)
loop1 int i = 2 -> code execute -> i++ then -> i = 3 ->condition=true ->(continued)
loop1 int i = 3 -> code execute -> i++ then -> i = 4 ->condition=false ->terminated
*/