Not restricted to any one programming language.
What I'm saying is you pass 1 to it and it returns Monday, 7 corresponds with sunday and so on.
I've managed a 146 byte statement in Java to do the same.
return (n<1?"invalid":(n<2?"monday":(n<3?"tuesday":(n<4?"wednesday":(n<5?"thursday":(n<6?"friday":(n<7?"saturday":(n<8?"sunday":"invalid"))))))));
Your program should:
- output full words (STDOUT)
- not crash if the input is less than 1 or greater than 7
invalid
if the input is invalid? The question doesn't state that but the example suggests so. \$\endgroup\$