# Liitle help with boolean expressions

Printable View

• 05-30-2006
Voyd
Liitle help with boolean expressions
Well as you can tell im a noob when it comes to programming but I want to learn and am a little confuzed.Hope somebody aint to busy and can help me out.

A. !( 1 || 0 ) ANSWER: 0
B. !( 1 || 1 && 0 ) ANSWER: 0 (AND is evaluated before OR)
C. !( ( 1 || 0 ) && 0 ) ANSWER: 1 (Parenthesis are useful)

Im reading the lesson 2:If statements and dont get it much.

The one I have trouble with is C.So if NOT is first right then the first 1 would evaluate to 0 hence false and then well it could not be true. :confused:

Feel so nooby lol :D hope somebody can help and pardon my typos main language is spanish...THX :D
• 05-30-2006
whiteflags
Code:

`C. !( ( 1 || 0 ) && 0 ) ANSWER: 1`
When you evaluate boolean algebra, know what operations take precedence and work from the inside out, just like in math.
Code:

```!(( 1 || 0 ) && 0 ) = !((1) && 0 ) = !(0) = 1```
• 05-30-2006
Voyd
Ah ok know I get it...thanks for your help really appriciate it :)