Switch Case
Think before you code.Print the weekday name for a day number 1-7, or Invalid otherwise.
easy
Switch Case
Given the integer day denoting the day number, print on the screen which day of the week it is. Week starts from Monday and for values greater than 7 or less than 1, print Invalid.
Ensure only the 1st letter of the answer is capitalised.
Usage
- C++:
cout << variable_name; - Java:
System.out.print(); - Python:
print() - JavaScript:
console.log()
Example 1
Input : day = 3
Output : Wednesday
Example 2
Input : day = 8
Output : Invalid
Example 3
Input : day = 2
Output : Tuesday
Constraints
0 <= day <= 50