Professional Documents
Culture Documents
Previous and New Assignment 19 and 20 January 2022
Previous and New Assignment 19 and 20 January 2022
Coding:- Output:-
“CONTROL FLOW in
javascript”
1:- IF.. ELSE:- The if-else statements executes block of code if a specified
condition is true. If the condition is false, another block of statement can be
executed.
Syntax:- if (condition) {
// block of code to be executed if the condition is true
} else {
// block of code to be executed if the condition is false
}
Coding:-
Output:-
2:- Switch Case:- The switch statement executes a block of code depending on
different cases.
Syntax:-
Switch (expression) {
case n1:
statements:
break;
case n2:
statements:
break;
default:
statements:
}
Coding:-
Some confusion about this will discuss in class………
Coding :- Output:-