Here is what I have coded so far:
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "Enter a month(as a number): ";
cin >> num;
if (num < 3 || num > 11)
{
cout << "Happy Winter\n";
}
else if (num > 7 || num < 9)
{
cout << "Happy Summer\n";
}
else if (num > 3 || num < 7)
{
cout << "Happy Spring\n";
}
else
{
cout << "Happy Fall\n";
}
return 0;
}
My program is not printing things how it is supposed to. My progrma is supposed to print: "Happy Winter" if it is strictly before 3 or strictly larger than 11, "Happy Spring" if it is 3 or greater, but strictly before 7, and "Happy Summer" if it is 7 or greater, but strictly before 9, and "Happy Fall" otherwise.
but for some reason it only prints "Happy Summer" no matter what number i input. the only line that works is the first if statement i coded. I'm not sure what I am doing wrong but i think it has to do with my my operations in the else if statements.