Thread: Noob getting confused by booleans

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    114

    Cool Noob getting confused by booleans

    Code:
    A. !( 1 || 0 )         ANSWER: 0	//how is that so?
    B. !( 1 || 1 && 0 )    ANSWER: 0 (AND is evaluated before OR) //how is that so?
    C. !( ( 1 || 0 ) && 0 )  ANSWER: 1 (Parenthesis are useful)
    In the if statement tutorial i got to the end of it and say these boolean statements and dont under stand how any of those eqaul to false or true
    Cause all i see its saying is Not 1 or 0
    Not 1 or 1 and 0 // By the way does 1 and 0 make it 10 or is the and function like adding ?

    Main question is how is not 1 or 0 eqaul to False When i see no variable around to define wat the number is




    thanks for clearing up the and question
    but wat im trying to ask is how do i no wat the number is in these 3 questions
    Last edited by Nathan the noob; 06-26-2008 at 04:39 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Confused with array size
    By desmond5 in forum C Programming
    Replies: 4
    Last Post: 12-04-2007, 05:14 PM
  2. New to C++ and confused by boolean and ifs and else
    By jconner in forum C++ Programming
    Replies: 10
    Last Post: 08-02-2006, 03:29 AM
  3. Confused
    By jeev2005 in forum C Programming
    Replies: 5
    Last Post: 06-01-2006, 02:04 PM
  4. Confused
    By (TNT) in forum C# Programming
    Replies: 1
    Last Post: 11-23-2005, 04:49 PM
  5. confused.. in selecting my line of deapth
    By jawwadalam in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-04-2003, 01:21 PM