How do I programmatically return the maximum of two integers without using any comparison operators and without using if, else, etc?
Since this is a puzzle, solution will be slightly convoluted:
let greater x y = signum (1+signum (x-y))
let max a b = (greater a b)*a + (greater b a)*b
This is Haskell, but it will be the same in any other language. C/C# folks should use "sgn" (or "sign"?) instead of signum.
Note that this will work on ints of arbitrary size and on reals as well.