In C, there is no "true" or "false" value - any nonzero value is true, and any zero value is false.
And the assignment operator "=" returns a value, so you can string them together:
a = b = c = 0;
So when you write an
if
statement, if the condition statement evaluates to a non-zero value - any non zero value - then the following line(s) of code will be executed.
And "=" is the assignment operator, while "==" is the equality comparison operator.
So look at your code, and see what you have used ... :D
To be honest, if you had used the debugger, you would have spotted that in a minute or maybe two and saved yourself a lot of time. It's well worth getting used to it as it's one of the best tools in a developers toolbox, and we all use it a lot. Get used to it on trivial projects like this and it'll stand you in good stead when you get to more complex ones.