Consider the following function:
What value is returned by the
call mystery(n,a,d)?
(Either write a number, or write "infinite recursion".)
ANS
If you trace this function, you should find that d is added to it self n-1 times. Then in the nth time (the base case), a is added to the sum.