forked from legendary-acp/Basic_programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalender.c
More file actions
61 lines (57 loc) · 1.12 KB
/
calender.c
File metadata and controls
61 lines (57 loc) · 1.12 KB
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
#include<stdio.h>
int main()
{
int month,year,i;
printf("Enter the month and year\n");
scanf("%d %d",&month,&year);
printf("Dates in month are: \n");
if(year%4==0)
{
if(month==1||3||5||7||8||10||12)
{
for(i=1;i<=31;i++)
{
printf("%d\n", i);
}
if(month==2)
{
for(i=1;i<=29;i++)
{
printf("%d\n",i);
}
}
}
else
{
for(i=1;i<=30;i++)
{
printf("%d\n",i);
}
}
}
else
{
if(month==1||3||5||7||8||10||12)
{
for(i=1;i<=31;i++)
{
printf("%d\n", i);
}
if(month==2)
{
for(i=1;i<=28;i++)
{
printf("%d\n",i);
}
}
}
else
{
for(i=1;i<=30;i++)
{
printf("%d\n",i);
}
}
}
return 0;
}