Thread: Some Help for Finals

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    2

    Question Some Help for Finals

    hello im new here and have scouted the internet and i like this page alot.. so i signed up and will probably read more so than post but i did have some questions, really basic stuff for a final tommrow any help would be great thanks soo much!!
    -------------------------------------------------------------------------------
    ok,
    in order of operations what comes first || or &&?
    also in order of operations what is first == or !=?


    finnally some loop stuff, i understand the code pretty decently i just dont know how many times the loop will be executed
    eg:

    int a = 10;
    int x = 4; ...oops

    do
    {
    cout << a << " --- " << x;
    cout << endl << "wow";
    }

    while (a<=x)

    ----------------------------------------------------------------------
    ... im guessing as long as "a" is less that or equal to "x"
    but what about like
    ----------------------------------------------------------------------

    int a = 20;
    int x = 4;
    while (x<=a)
    {
    cout << a << "---" << x;
    cout << endl << 'wow";
    a--;
    x++;
    }

    ------------------------------------------------------------------------
    i get lost here with the -- ++ stuff.. retarted i know..
    again any help is much appritiated and if no help well i just will go and stare at my book for along time sniff
    Last edited by JSUencode; 12-09-2002 at 05:01 PM.

  2. #2
    Registered User Pioneer's Avatar
    Join Date
    Dec 2002
    Posts
    59
    && comes before ||, == and != are the same, there's no telling because you don't know what x is, and 9.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    When in doubt use parenthesis. You should try and use parenthesis anyway since it makes you code more readable.

  4. #4
    Registered User
    Join Date
    Dec 2002
    Posts
    2
    much thanks!

Popular pages Recent additions subscribe to a feed