#include<stdio.h>
main()
{
int m, d, y;
printf("Enter month");
scanf (&m);
printf ("Enter day");
scanf (&d);
printf ("Enter year");
scanf (&y);
printf ("The day after ", m, "/ ", d, "/ ", y, " is: ");
d++;
if (d>30)
{
d=1;
}
m++;
if (m>12)
{
m=1;
}
y++;
printf (m," / ",d," / ",y);
return 0;
}
this is a half ass job because I don't remember the syntax correctly but will make changes as I read google ...
The code might not compile, I cannot do this at work and the code is sloppy
Also, there are shortcuts to the code, and can be optimized as I have written it is just a high school way of doing things
Why do you increment day after
cout<<"The day after "<<m<<"/"<<d<<"/"<<y<<" is: ";
Conversely you could do the following
#include<stdio.h>
main()
{
int m, d, y;
printf("Enter month, day, year separated by comma - hit Enter when done: ");
scanf (" %d, %d, %d", &m, &d, &y);
printf ("The day after ", m, "/ ", d, "/ ", y, " is: ");
BLAH
}