Monday, 26 August 2013

How to evaluate this statement? (uses #define)

How to evaluate this statement? (uses #define)

If I defined the absolute value of a number as
#define ABS(X) X >= 0 ? X : (-1) * X
what would
ABS(2) + ABS(-3)
evaluate to? My friend claims it evaluates to 2.

No comments:

Post a Comment