{if (n > 0) return 1;else return -1;} function f(int a, int b){if (a > b) return g(a-b);if (a < b) return g(b-a); return 0;}If f(a,b) is called, what is returned?
A. 1 if a > b, -1 if a < b, 0 otherwise
B. Always +1
C. 0 if a equals b, +1 otherwise
D. -1 if a > b, 1 if a < b, 0 otherwise
Answer:C
{if (n > 0) return 1;else return -1;} function f(int a, int b){if (a > b) return g(a-b);if (a < b) return g(b-a); return 0;}If f(a,b) is called, what is returned?
A. 1 if a > b, -1 if a < b, 0 otherwise B. Always +1 C. 0 if a equals b, +1 otherwise D. -1 if a > b, 1 if a < b, 0 otherwise