Home » » Switch case in Javascript Example

Switch case in Javascript Example

Switch case in Javascript Example

Switch case in Javascript Example

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>


0 coment�rios:

Post a Comment

Link you don't want to vouch for Read more: https://html.com/seo/#ixzz5zVltiZ5g