Switch case statement is used to select one of many blocks of code to be executed.
Syntax:
Switch(expression)
{
case 'condition':
Block statement(s);
break;
case 'condition2':
Block statement(s);
break;
case 'condition3':
Block statement(s);
break;
.....................
.....................
case 'condition n':
Block statement(s);
break;
default:
Block statement(s);
break;
}
Write a program in javascript to display message depending on which day of the week it is using switch case.
switch case
output:
PRACTICAL
Comments
Post a Comment