What is the value returned by the recursive function ackermann(2,3) ? int…

TPSC Computer/IT Posts 2026

What is the value returned by the recursive function ackermann(2,3) ?

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)) ;
}

  1. A.

    16

  2. B.

    20

  3. C.

    25

  4. D.

    30

Attempted by 346 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…