Menu Close

Find the day on providing the week number

Britta’s parents said they will buy her a puppy on a 2nd week of a month. They selected a puppy but the vet said it will be delivered only based on the token given to them. The token was printed from 1-7 in number representing days of the week.

Britta is very eager and needs to Know the Day on providing the week number [1-7]. 

Can you help her? 
If the input is other than 1 to 7 print “Invalid Input”

Input: 
Single line Containing an integer representing a day.

Output: 
Print the Day corresponding to a number 
#include <stdio.h>
int main()
{
    int day;
    scanf("%d",&day);
    if(day==1){printf("Monday");}
    else if(day==2){printf("Tuesday");}
    else if(day==3){printf("Wednesday");}
    else if(day==4){printf("Thursday");}
    else if(day==5){printf("Friday");}
    else if(day==6){printf("Saturday");}
    else if(day==7){printf("Sunday");}
    else{printf("Invalid Input");}
	return 0;
}

INPUT_1:
7

OUTPUT:
Sunday


INPUT_2:
12

OUTPUT:
Invalid Input


INPUT_3:
1

OUTPUT:
Monday



Morae Q!