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.
Printable View
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.
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.