0
1.8kviews
Consider the following recursive function that takes two arguments
Int foo (int n. int r)

{
If(n>0)
Return((n%r)+foo(n/r,r));
Else
Return 0;
}

What is the return value of the function foo when it is called as foo (65,2)? -

Marks: 3 M

Year: Dec 2014

1 Answer
0
42views

The implementation of the above mentioned function for values n=65 and r=2 can be described as follows:

enter image description here

Thus, the final output for n=65 and r=2 is 0+1+0+0+0+0+0+1=2

Please log in to add an answer.