-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdays.c
41 lines (38 loc) · 837 Bytes
/
days.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<stdio.h>
void main ()
{
// Store the number of the day
int day_number;
// Input the day
printf("Enter the any value from 1 to 7 to get the name of the day: ");
scanf("%i", &day_number);
// Show the name of the day
// ASSUMPTION: First day of the week is on Sunday
switch (day_number)
{
case 1:
printf("Sunday\n");
break;
case 2:
printf("Monday\n");
break;
case 3:
printf("Tuesday\n");
break;
case 4:
printf("Wednesday\n");
break;
case 5:
printf("Thursday\n");
break;
case 6:
printf("Friday\n");
break;
case 7:
printf("Saturday\n");
break;
default:
printf("\nYour value was not in the specified range( 1 to 7).\n");
break;
}
}