What will be the output for the pseudo-code for p=22, q=127 fun(int p,int q)…

PYQ Infosys Hiring Test 2025

What will be the output for the pseudo-code for p=22, q=127

fun(int p,int q)

if (p == 1)

return q;

else if (p%2==0)

return fun (p - 1 , q);

else

return 0;

  1. A.

    9

  2. B.

    6

  3. C.

    5

  4. D.

    None of the above mentioned

Attempted by 83 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…