Thread: Reply to CodeMonkey (thread got closed!!!)

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Reply to CodeMonkey (thread got closed!!!)

    CodeMonkey wrote:
    if 1 = 2 && 2 = 1,
    what is 3 - (2*2) + 1?
    Assuming you can do what you can't do (changing constant values) this is the answer:

    ¤You set 1 to 2
    ¤You set 2 to 1, but 1=2 so 2 is still 2
    ¤3-(2*2)+1 is 3-(2*2)+2 which is 1

    Answer: 1

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    No, all the 2's change to 1's and the 1's change to 2's
    so the equasion now is:

    3 - (1*1) + 2
    = 3 - 1 + 2
    = 2 + 2
    = 4

  3. #3
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Visit entropysink.com - It's what your PC is made for!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multithreading (flag stopping a thread, ring buffer) volatile
    By ShwangShwing in forum C Programming
    Replies: 3
    Last Post: 05-19-2009, 07:27 AM
  2. Thread confusion
    By pyrolink in forum C Programming
    Replies: 0
    Last Post: 01-29-2006, 09:42 PM
  3. Win32 Thread Object Model Revisted
    By Codeplug in forum Windows Programming
    Replies: 5
    Last Post: 12-15-2004, 08:50 AM
  4. How to make a thread sleep or std::recv timeout?
    By BrianK in forum Linux Programming
    Replies: 3
    Last Post: 02-26-2003, 10:27 PM
  5. Multithreading
    By Cela in forum Windows Programming
    Replies: 13
    Last Post: 01-15-2003, 03:02 PM