Good to see you understand the errors, and more so that you learn from them.
As i told you the program would print numbers. We use enum, so that we can write programs that are more descriptive of their operation.
Code:
....
26 else if (hour > 47 && hour < 72)
27 day = 2;
Which is more understandable, your version or the one i wrote here?
If you need to print the days of the week in human readable format you will need to tell your program, to map the numbers to text. We usually use an array of constant string to do that.
For example.
I would write:
Code:
enum fruit {Apple, Orange, Banana, Lemon};
char fruitName[4][7] = {"Apple", "Orange", "Banana", "Lemon"};
int main()
{
int iLike;
printf("What fruit do you like?\n");
printf("1. Apple\n");
printf("2. Orange\n");
printf("3. Banana!\n");
printf("4. Lemon?\n");
scanf("%d", &iLike);
iLike++; /* the enum constants start from 0 in this example */
if(iLike==Apple || iLike==Orange || iLike==Banana || iLike==Lemon)
printf("So you really like [%s]? Me too!\n", fruitName[iLike]);
else
printf("Hmmm... raw meat sound good to you huh?\n");
return 0;
}
Notice the use of the human readable names to verify that the user actually likes a fruit.
Doesn't it make it much easier to read the purpose of the program?