-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathleap.c
More file actions
42 lines (40 loc) · 854 Bytes
/
leap.c
File metadata and controls
42 lines (40 loc) · 854 Bytes
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
#include <stdio.h>
int main()
{
int m;
printf("Enter the Month No:");
scanf("%d", &m);
switch (m)
{
case 8:
printf("There are 31 days in this year");
goto end;
case 2:
printf("there are 28 days");
goto end;
case 9:
printf("There are 30 days in this year");
goto end;
case 10:
printf("there are 31 days");
goto end;
case 11:
printf("There are 30 days in this year");
goto end;
case 12:
printf("there are 31 days");
goto end;
}
if (m > 12)
{
printf(" This is not a valid month.");
}
else if (m % 2 == 0)
{
printf("There are 30 days in this year");
}
else
printf("There are 31 days in this year");
end:
return 0;
}