PDA

View Full Version : IDEA: Addition function



Magos
09-16-2002, 04:43 AM
The task is to make a function that adds two numbers.
Int, short, char? You decide!

Sounds simple, huh? Well, here's the catch. You are not allowed to use any mathematical operator, like +,-,* or /, nor use any libraries (except for printing functions, like cout and printf).
However, you are allowed to use binary operators, like &, | or ^ (is that xor?), and the assignment operator (=).

Hammer
09-16-2002, 04:56 AM
Didn't we do this one already? (http://contests.cprogramming.com/index.php?request=Goto...&theme=03a)?

Magos
09-16-2002, 09:43 AM
Hmmm...
I didn't look at all other earlier ideas.... :(