• archie flockhart (10/14/2009)


    Not only a trick question, but one that is possible to get right by getting the reasoning all wrong...

    If you don't know that AND and OR operate bitwise on integers, you might assume that it works like Excel's AND() function which treats nonzero values as TRUE and zeroes as FALSE. Then it would return 1 as the value, even if all the variables were declared as INT.

    So you'd get the right answer, but for the wrong reason - and you'd go away "knowing" something about these operators that "ain't so".

    Exactly what I did :Whistling:

    Only I didn't go away "knowing" something, I came here and found out the truth 🙂