Question: )What does the following recursive function return when x = 2 and n = 4 ? int what_do_I_do ( int x, int n ) {

)What does the following recursive function return when x = 2 and n = 4 ?

int what_do_I_do ( int x, int n )

{

if ( n = = 1 )

return x;

else return x * what_do_I_do ( x, n 1 );

}

What does the function return for any positive values of x and n ? The answer should be a

general formula in terms of x and n.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!