What is the value returned by the recursive function ackermann(2,3) ? C int…
2026
What is the value returned by the recursive function ackermann(2,3) ?
C
int ackermann(int i, int j){
if(i == 0) return 2*j;
else if (j == 1) return 2;
else return ackermann(i-1, ackermann(i, j-1)) ;
}Answer: A. 16
- A.
16
- B.
20
- C.
25
- D.
30
Attempted by 246 students.
Show answer & explanation
Correct answer: A
Loading lesson…