Calculate the value of X using recursion
X=(p*q)/1!+ (p-1*q-1)/2!+ (p-2*q-2)/3! + (p-3*q-3)/4! +
(p-4*q-4)/5!
'p' and 'q' are the user inputs.
Today,I got this question in my test paper.
just wondering how it would have been implemented.
Calculate the value of X using recursion
X=(p*q)/1!+ (p-1*q-1)/2!+ (p-2*q-2)/3! + (p-3*q-3)/4! +
(p-4*q-4)/5!
'p' and 'q' are the user inputs.
Today,I got this question in my test paper.
just wondering how it would have been implemented.
Last edited by Modest Mouse; 10-10-2011 at 10:38 AM.
Read our homework policy. Then, read the forum guidelines, and post your effort in code tags. I'm not really sure how much help you'll get though, considering this is for your test. It is fairly simple, however, and can be implemented in very few lines of code. Maybe you should read some tutorials on recursion.
thanks 4 d reply.will surely check the link.