Does anyone know why the line after "else if (month >9)" will not execute? If I remove "cout << "Duck";", it will not execute the line "if ((inmonth%2) == 0)", but if "cout << "Duck";" is present, it will skip that line and execute the rest of the program. If anyone could give me some insight as to why, I'd really appreciate it. Thank you!
elseif (month >9) // If month is after september
cout << "Duck";
if ((inmonth%2) == 0)
// If month is divisble by two
{
cout << "Please enter the day of the month: ";
cin >> day;
inday = day;
if (day < 1 || day > 31 || day - inday != 0)
{
cout << "I'm sorry, this is not a valid day.";
return 0;
}
else
cout << month << "/" << day << "/" << year << "is a valid date." << endl;
return 0;
}