Khan.randRange(2, 6) Khan.randRange(0, 5) Khan.randRange(0, 5) (n-1)*d + a

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.