-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSwitch_con_ope.c
56 lines (45 loc) · 1.47 KB
/
Switch_con_ope.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include<stdio.h>
int main(){
int day; //like:: 1-saturday , 2-sunday, 3, monday....etc
printf("Enter a number from 1-7 for finding day:");
scanf("%d",&day);
switch(day){
case 1 : printf("Satarday\n");
break;
case 2 : printf("Sunday\n");
break;
case 3 : printf("Monday\n");
break;
case 4 : printf("Tuesday\n");
break;
case 5 : printf("Wednesday\n");
break;
case 6 : printf("Tursday\n");
break;
case 7 : printf("Friday\n");
break;
default : printf("The input number did not match with any day");
}
// Another taste with charecters................
char day_n; //like:: 1-saturday , 2-sunday, 3, monday....etc
printf("Enter First latter of the day for finding day:");
scanf("%c",&day_n);
switch(day_n){
case 'S' : printf("Satarday\n");
break;
case 's' : printf("Sunday\n");
break;
case 'M' : printf("Monday\n");
break;
case 'T' : printf("Tuesday\n");
break;
case 'W' : printf("Wednesday\n");
break;
case 't' : printf("Tursday\n");
break;
case 'F' : printf("Friday\n");
break;
default : printf("The input number did not match with any day");
return 0;
}
}