Look at line 15, there is no such thing as five, you should have written the number 5: if(userInput < 5)
And why they both work the same is because when you pass an int to a if statement, it converts to a bool. A bool can be true or false. The number 0 is true and any other is false. So the == true is optional.
Btw if you want a true or false type, you are better of going with a bool. (Line 8 bellow)
Thanks! I understand now how that concept works... and wow that 'five' error was stupid! I just wrote up a simple program to explain my confusion. And yes i know i could have done that. Thanks again.
0 is false, and anything else is true. Generally 1 is used for true though. IIRC functions only check if they are false (equal to 0) and don't even check if they are true, if they are not false they must be true. So (-∞, 0)∪(0,∞) are true.