-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQ12.c
40 lines (37 loc) · 928 Bytes
/
Q12.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
//C program to create Simple Calculator AND Days of week using switch case.
//C program to create Simple Calculator AND Days of week using switch case.
#include <stdio.h>
int main()
{
int week;
/* Input week number from user */
printf("Enter week number(1-7): ");
scanf("%d", &week);
switch(week)
{
case 1:
printf("Monday");
break;
case 2:
printf("Tuesday");
break;
case 3:
printf("Wednesday");
break;
case 4:
printf("Thursday");
break;
case 5:
printf("Friday");
break;
case 6:
printf("Saturday");
break;
case 7:
printf("Sunday");
break;
default:
printf("Plese enter valid data");
}
return 0;
}