– What does this function compute for positive n?function f(int n){if (n equals 1) { return 1}else{ return f(n-1)/f(n-1) + n}}
A. 1 + n
B. 1 + 2 + 3 + … + n
C. 1 + n, if n > 1, 1 otherwise
D.None of the above
Answer:C
– What does this function compute for positive n?function f(int n){if (n equals 1) { return 1}else{ return f(n-1)/f(n-1) + n}}
A. 1 + n B. 1 + 2 + 3 + … + n C. 1 + n, if n > 1, 1 otherwise D.None of the above
Explanation: As the f(1)/f(1)+2 become: 1+2 in all cases.