Error Help - Skips Line

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!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  else if (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;
            }
Can you please post your full code?
We cannot read your mind.

What is above else if (month > 9)???
Last edited on
What value of month did you test?
I had someone read over my code and explain it to me. Thank you!
Topic archived. No new replies allowed.