-
Language
C
-
Description
Next date
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
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
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
int day, month, next_day, next_month, next_year;
int year;
printf ("Enter the value of day: ");
scanf ("%d", &day);
(void) getchar ();
printf ("Enter the value of month: ");
scanf ("%d", &month);
(void) getchar ();
printf ("Enter the value of year: ");
scanf ("%d", &year);
(void) getchar ();
if((day==30&&(month==4||month==6||month==9||month==11))||day==31||(month==2&&(day==29||(day==28&&(year%4!=0||year%100==0)&&year%400!=0))))
{
next_day=1;
next_month=month+1;
}
else
{
next_day=day+1;
next_month=month;
}
if(next_month==13)
{
next_year=year+1;
next_month=1;
}
else
next_year=year;
printf ("Value of next day: %d\n", next_day);
printf ("Value of next month: %d\n", next_month);
printf ("Value of next year: %d\n", next_year);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}
#include <stdlib.h>
int main (void)
{
int day, month, next_day, next_month, next_year;
int year;
printf ("Enter the value of day: ");
scanf ("%d", &day);
(void) getchar ();
printf ("Enter the value of month: ");
scanf ("%d", &month);
(void) getchar ();
printf ("Enter the value of year: ");
scanf ("%d", &year);
(void) getchar ();
if((day==30&&(month==4||month==6||month==9||month==11))||day==31||(month==2&&(day==29||(day==28&&(year%4!=0||year%100==0)&&year%400!=0))))
{
next_day=1;
next_month=month+1;
}
else
{
next_day=day+1;
next_month=month;
}
if(next_month==13)
{
next_year=year+1;
next_month=1;
}
else
next_year=year;
printf ("Value of next day: %d\n", next_day);
printf ("Value of next month: %d\n", next_month);
printf ("Value of next year: %d\n", next_year);
putchar ('\n');
system ("pause");
return EXIT_SUCCESS;
}