Results 1 to 15 of 29

Threaded View

  1. #1
    crushed's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    My name is Jay. k?
    Posts
    415
    Reputation
    10
    Thanks
    113
    My Mood
    Sneaky

    Boolean operators.

    So yeah, I haven't really posted in a while, due to me not really doing anything in C++ due to school. But picking up now once more. Anyways, I've just been starting, so yeah. I'm doing lessons from pretty much everywhere now, I learn something new from every other book, whether it be the first lesson.

    So yeah, I was reading the 2nd Lesson on Cprogramming.com and I got really confused at one part. ._.

    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)

    AND OR NOT. The three operators of Boolean. Can someone explain to me what they mean? Like I know that !=not ||=or &&=and.

    But I mean, how they are used, and if possible, can you give me an example in a code, cause it's much easier for me to understand. Also, since I don't want to repost another thread. The break statement is used to break loops, correct? And the continue statement skips to the next part of the code? ._.;

    Sorry if it sounds confusing, but yeah. I'm still not finished Basics due to school, but I have 2 weeks of in which I intend to cover most of the basics.

    Thanks to those help, and thank you for your time.

    EDIT: An example I tried was
    Code:
    int main()
    {
       int a=10;
       if (a != 20){
                cout <<"Hi. I'm failing basics.";
             }
       return 0;
    }
    I understand that example, because it basically means if a does not equal 20, print the following. But I mean, the other ones are confusing to me, mostly or as well as and.
    Last edited by crushed; 12-18-2009 at 11:42 PM.

Similar Threads

  1. d.vel.oper
    By Jeckels in forum WarRock - International Hacks
    Replies: 14
    Last Post: 10-16-2007, 01:53 PM
  2. Operation Northwoods
    By Grim09 in forum General
    Replies: 12
    Last Post: 07-21-2007, 12:45 AM
  3. [RELEASE] Operation Kcah V1.0
    By ArtofLife in forum WarRock - International Hacks
    Replies: 19
    Last Post: 06-09-2007, 03:34 PM
  4. Dont Sample The Boolean
    By kvmn8 in forum General
    Replies: 3
    Last Post: 06-15-2006, 08:48 AM