A question I got on my last interview:
Design a function f, such that: f(f(n)) == -n Where n<
Design a function f, such that:
f
f(f(n)) == -n
Where n<
n<
Uses globals...but so?
bool done = false f(int n) { int out = n; if(!done) { out = n * -1; done = true; } return out; }