Friday, November 25, 2016

if ; if...else ; if ...else if...else , switch

To evaluate multiple expressions.

1. if Statement

if (condition)
  {

   }

2. if... else  Statement

if (condition)
  {

   }
else 
  {

  }

3. if... else if... else  Statement

if (condition)
  {

   }
else if
  {

  }

else
  {

  }


Use switch Statement to evaluate only one expression. executing different code according to the result of that expresiion evaluates to a simple type(a number, string or boolean)

switch (expression) {
 case result1;

 case result2;

default ;

}

1 comment:

  1. If you’re need to find a developer for your project, here check out this list of.

    ReplyDelete