Skip to content

Commit

Permalink
For Loop
Browse files Browse the repository at this point in the history
  • Loading branch information
smartherd committed Jun 11, 2018
1 parent 8d49add commit f3a85b5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions 8_for_loop.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

void main() {

// FOR Loop

// WAP to find the even numbers between 1 to 10

for (int i = 1; i <= 10; i++) {

if ( i % 2 == 0) {
print(i);
}
}


// for ..in loop
List planetList = ["Mercury", "Venus", "Earth", "Mars"];

for (String planet in planetList) {
print(planet);
}
}

0 comments on commit f3a85b5

Please sign in to comment.