Cannot get my Code in C to work

Asterios

Estimable
Oct 19, 2014
2
0
4,510
My code is supposed to be pretty simple I've searched around the web but can't find much that helps so I was wondering if my code should be a switch statement rather than an if one...

Here's my code...

#include <stdio.h>

int main(void)
{
int num;
scanf("%d",&num);
if (num <= 4 && num >= 11)
{
printf ("Good Morning!");
}
else if (num <=12 && num >=18)
{
printf ("Good Afternoon");
}
else if (num <=19 && num >=23)
{
printf ("Good Evening");
}
else if (num <=0 && num >=3)
{
printf("Good Night!");
}
else
{
printf ("Error Invalid Output!");
}
return 0;
}
 
Solution
We normally don't help with homework, but in this case:
Check your '>' and '<' symbols - they're round the wrong way.

Exact errors and examples of what the expected and actual output is usually help.

Asterios

Estimable
Oct 19, 2014
2
0
4,510


You're right thanks - however this isn't homework. Thanks for the help!