Determining next date using structures
Hello all, I am trying to construct a c program that accepts a user entered date and then prints the following day. Eventually I need to get it so it is accurate to the month that it is in, but as a first step I am just trying to get the next day part to work correctly. This is the code that I have currently. I think my problem is with my scanf statements but I'm not sure exactly what the problem is. Help would be greatly appreciated.
Code:
#include <stdio.h>
struct date
{
int month;
int day;
int year;
};
int main()
{
int tomorrow;
struct date tom;
puts("Enter date in the format m/d/yy\n");
scanf("%d",&tom.month);
scanf("%d",&tom.day);
scanf("%d",&tom.year);
tomorrow=tom.day+1;
printf("Tomorrow's date is: %d/%d/%d \n",tom.month,tomorrow,tom.year % 100);
system ("PAUSE");
return 0;
}