>> int abs(int input)
>>> {
>>> int value = 0;
>>> for (int n = input; n != 0; n++)
>>> {
>>> value++;
>>> }
>>> return value;
>>> }
>>
>> That's a pretty epic fail.
>
> As I say, the impressive thing is that it's a correct (yet inefficient)
> implementation of negate().
Yes, there must be a prize for that somewhere, but presumably not one
that involves working at your company :-) I wonder what would have
happened if you'd asked him to implement an "add" function...?
Post a reply to this message
|