Write a program to show day of the week using switch

Description:

Write a program to show day of the week (for example: Monday) based on numbers using switch/case statements.

Conditions:

  • You can pass 1 to 7 number in switch
  • Day 1 will be considered as Monday
  • If number is not between 1 to 7, show invalid number in default

Click to View Solution/Program

Output:

  It is Friday!