If Statement Example Program in Dart


It starts with a multi-line comment that provides an overview of the concept of decision making in Dart programming, particularly the if statement, if else statement, else if statement, and nested if statement.

The next line declares a variable a and initializes it with the integer value 2. The following line begins an if statement. The condition a>=5 is checked, which evaluates to false since a is less than 5. Therefore, the block of code inside the if statement is not executed, and nothing is printed to the console.

Overall, this code demonstrates the basic syntax of an if statement and how it can be used to execute code based on a certain condition. In this case, the code does not execute because the condition is not met.

Source Code

void main() {
	/*
      Dart Programming - Decision Making
        if Statement
        if else Statement
        else if Statement
        Nested if Statement
    */
    var a=2;
    if(a>=5)
      print('You are eligible');
}
To download raw file Click Here