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
Get step-by-step solutions from verified subject matter experts
