From f3a85b5e494a11edef9265c5e1c1ee832ce40bc4 Mon Sep 17 00:00:00 2001 From: Smartherd Date: Mon, 11 Jun 2018 15:07:03 +0530 Subject: [PATCH] For Loop --- 8_for_loop.dart | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 8_for_loop.dart diff --git a/8_for_loop.dart b/8_for_loop.dart new file mode 100644 index 0000000..01e767a --- /dev/null +++ b/8_for_loop.dart @@ -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); + } +}