If Else Statement Example Program in Dart


Example Program:

Here is the simple program for printing basic example of if else statement in dart.

Source Code

import 'dart:io';
void main() {
   var age,name;
   print('Enter Your Name and Age : ');
   name=stdin.readLineSync();
   age=int.parse(stdin.readLineSync());
   if (age >= 18) 
   {
      print('$name  age is $age You are eligible');
   }
   else
   {
      print('$name age is $age You are Not eligible');
   }
}
To download raw file Click Here

Output

Enter Your Name and Age : 
Ram
20
Ram  age is 20 You are eligible


Learn All in Tamil © Designed & Developed By Tutor Joes