VB.NET Decision Making Statements


  • Decision Making Statement allows user to choose one path from the two or more execution path on the basis of condition or we can say that these statements provide the facility to select one option from the given option on the behalf of some condition. If the condition is true then one set of statement will be executed and if the condition is false another set of statement will be executed.
  • A basic diagram for decision making statement is given below:
  • VB.NET includes following decision making statements:
  • decision-making

    StatementDescription

    if statement

    An if statement consists of a boolean expression followed by one or more statements.

    If..Then..Else statement

    An if statement can be followed by an optional else statement, which executes when the boolean expression is false.

    If..Then..Else if..Else statement

    An if statement can be followed by an optional else statement, which executes when the boolean expression is false.

    Nested If statement

    You can use one if or else if statement inside another if or else if statement(s).

    Select….Case statement

    A switch statement allows a variable to be tested for equality against a list of values.