forked from crypticani/C_Programs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
WEEKDAYS.C
82 lines (81 loc) · 1010 Bytes
/
WEEKDAYS.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
{
int d,y;
printf("Enter the no. of day to get the name of week :\n");
scanf("%d",&d);
if(d>=0&&d<7)
{
switch(d){
case 1 :
{
printf("Sunday");
}
break;
case 2 :
{
printf("Monday");
}
break;
case 3 :
{
printf("Tuesday");
}
break;
case 4 :
{
printf("wednesday");
}
break;
case 5 :
{
printf("Thursday");
}
break;
case 6 :
{
printf("Friday");
}
break;
case 7 :
{
printf("Saturday");
}
break;
default:
printf("please enter the no. of weekday from 1.");
}
}
else if(d>=7)
{
y=d%7;
switch(y){
case 1 :
printf("Sunday");
break;
case 2 :
printf("Monday");
break;
case 3 :
printf("Tuesday");
break;
case 4 :
printf("Wednesday");
break;
case 5 :
printf("Thursday");
break;
case 6 :
printf("Friday");
break;
case 7 :
printf("Saturday");
default :
printf("Saturday");
}
}
getch();
}}