26. Day Name From Number
Foundation1000 ms256 MBSolved by 0%
Read a number from 1 to 7 and print the day of the week, where 1 is
Monday and 7 is Sunday.
If the number is outside that range, print Invalid.
Constraints - `-100 ≤ n ≤ 100`
Input
A single line containing one integer n.
Output
Print the day name with a capital first letter, or Invalid if the number is outside 1 to 7.
Input1
OutputMonday
Noteis the first day
Input5
OutputFriday
Noteis in the middle of the range
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.