loops

 /// for loop, while loop, do While loop

void main() {
/// for loop
// for(int i=0; i<10; i++) {
// if(i<5) {
// print("This is Smaller");
// }
// print("Hello World!");
// }

// for(int i=5; i<50; i=i+5) {
// print("$i");
// }

/// Example of While loop
int i=0;
while(i<50) {
// i = i + 5;
print("$i");
i = i + 5;
}

/// while loop
// int no = 10;
// while(no<=50) {
// print("No is $no");
// no++;
//}

/// do while loop
// In do while loop, do block must execute once after will check while condition, if while loop condition satisfied
// then do loop will execute again otherwise not
// do {
// print("Usage of Do While Loop");
// }while(no<100);
}

Comments

Popular posts from this blog

Pagination with Bloc Pattern in Flutter

Pagination First Practical in Flutter

ExpansionPanel with ExpansionPanelList with Complete Collapse Operation in Flutter