V.Vidhya Logo

V.Vidhya

switch (Conditional Statements)


Q1.

Use switch statement to print the day of the week using a variable day with possible values 1 to 7.

Below it shows, which day each number represents.

1 = Monday, 2 = Tuesday & so on…

// if the `day` variable is currently given the value 2

// expected output
Tuesday

Prev Post
Logical Operators
Next Post
Conditional Statements Cumulative (with Alert & Prompt)