Skip to content

Commit f3a85b5

Browse files
committed
For Loop
1 parent 8d49add commit f3a85b5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

8_for_loop.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
void main() {
3+
4+
// FOR Loop
5+
6+
// WAP to find the even numbers between 1 to 10
7+
8+
for (int i = 1; i <= 10; i++) {
9+
10+
if ( i % 2 == 0) {
11+
print(i);
12+
}
13+
}
14+
15+
16+
// for ..in loop
17+
List planetList = ["Mercury", "Venus", "Earth", "Mars"];
18+
19+
for (String planet in planetList) {
20+
print(planet);
21+
}
22+
}

0 commit comments

Comments
 (0)