Minggu, 27 Januari 2019

Details Of Switch Example Statement

      A switch contention allows a variable to locomote tested for equality against a listing of values. Each value is called a case, too the variable beingness switched on is checked for each switch case.

Syntax
 switch(expression)
{
  illustration condition_variable-1:
          statements;
          break;
  illustration condition_variable-2:
          statements;
          break;
  illustration condition_variable-3:
          statements;
          break;
      --------------
      --------------
      --------------
  illustration condition_variable-n:
          statements;
          break;

default:
           statements;
}


Example
 a=3;
switch(a)
illustration 1:
{
      alert("One");
      break;
illustration 2:
      alert("Two");
      break;
illustration 3:
      alert("Three");
      break;
default:
       alert("no status matched");
}



Flow Chart


Example Program:- (Editor)


Editor is Loading...

Advertisement





Tags:
switch illustration contention inwards allinworld99, switch inwards javascript, illustration contention inwards javascript,switch too illustration inwards allinworld99 javascript.

Tidak ada komentar:

Posting Komentar