zaagan
7/11/2019 - 1:46 AM

Dart Else If Ladder

Dart Else If Ladder

/* Syntax */
if (boolean_exp1) { 
   // If exp1 evaluates to true 
} 
else if (boolean_exp2) { 
   // If the exp2 evaluates to true 
} 
else { 
   // If both exp1 and exp2 are false
} 
/* Example */
var balance = 600.75; 
if (balance < 500) { 
  print("Hey !! You are running out of money !!"); 
} else if(balance > 2500){
  print("Happy journey !!");
} else {
  print("You will survive the day !!");
}