Switch case in Javascript Example

Switch case in Javascript Example

Switch Statement Javascript Example


switch statement javascript example,example of switch statement in javascript,javascript switch multiple case,switch case default javascript,switch case syntax in javascript


Switch case

<html>
<head>
<title>
welcome
</title>
</head>
<body>
<script>
var a;
a=1;
switch(a)
{
case 1:
{
var b,c,d;
b=20;
c=40;
d=b+c;
document.write("The value of d is:"+b);
break;
}
case 2:
{
var b,c,d;
b=30;
c=33;
d=b-c;
document.write("The value of d is :"+d);
break;
}
case 3:
{
var b,c,d;
b=33;
c=33;
d=b*c;
document.write("The value of d is:"+d);
break;
}
case 4:
{
var b,c,d;
b=30;
c=33;
d=b/c;
document.write("The value of d is:"+d);
break;
}
default:
{
document.write("you are not eigible ofr entry");
break;
}
}
</script>
</body>
<html>


Post a Comment

0 Comments