1. The boolean operator NOT(!)

Hi, I'm going through the C-tutorial(beginner) and I want to know if I have understand it right.

Code:
`A. !( 1 || 0 )         ANSWER: 0`
Isnt really hard. (1 OR 0 is true) = false in this case.

Code:
```B. !( 1 || 1 && 0 )    ANSWER: 0 (AND is evaluated before OR)
C. !( ( 1 || 0 ) && 0 )  ANSWER: 1 (Parenthesis are useful)```
These two I dont understand so well.

Code:
`B. !( 1 || 1 && 0 )`
&& are operated before || so 1 && 0 is false because both numbers must be true. But what happens after that? Now we have

1 || FALSE and FALSE replaces 1 && 0. Could someone explain this? I was thinking if it would look like this after the &&-operation is done:

1 || 0 - the zero replaces the 1 && 0 wich was false. Am I thinking right?

And the last one:
C. !( ( 1 || 0 ) && 0 ) ANSWER: 1 (Parenthesis are useful)

the 1 || 0 is operated and is true(1) Then 1 && 0 is operated wich is false. The NOT-operator inverts this to true.

2. It's easier to do step by step. These are all equal, see if you can understand these steps:
Code:
```!( 1 || 1 && 0 )
!( 1 || (1 && 0) )
!( 1 || 0 )
!1
0```
If you can, try it yourself with the other example.

3. Don't forget that they are short-circuit operators.
So

!( 1 || 1 && 0 )
!( 1 || (1 && 0) )
! (1) // no need to evaluate (1 && 0) since 1 || anything is 1 !

4. || if either is, or both are, !0, the result is 1, otherwise 0
&& iff both are !0, the result is 1, otherwise 0

5. Thanks people, Ima write some programs and combine them in loops and stuff so I don't forget them...