I have a question with my date valid program, when I put in the date in the format MMDDYY it is supposed to check the MM (month), the DD (day), and the year (year). When I put in the date (ex. 121201) it doesn't go to either of the printf statements instead when I press enter it just goes the next line down without any printf output. When the program worked before, if I put in 121201 it would come out as 12121 which I am not sure why it does that. Any solutions that would get this program to work?
Code:
#include <stdio.h>
int main(void) {
int month;
int day;
int year;
printf("Enter the date in the format MMDDYY: ");
scanf ("%d%d%d", &month, &day, &year);
if( month <= 12 && month > 00 && day <= 31 && day > 00 && year >= 00 && year <= 99 )
printf("\n%d%d%d the date is valid\n\n", month, day, year);
else
printf("\n%d%d%d the date is not valid\n\n", month, day, year);
return 0;
}