d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Iso C++ Help > Ft Fg
Add Reply New Topic New Poll
Member
Posts: 4,729
Joined: Apr 4 2008
Gold: 596.00
Oct 11 2016 11:55am
i need help figuring this problem out will to pay fg for it

Write a program that will prompt a user to enter 2 values that represent the permutations of n things taken r at a time. Your program should calculate the number of permutations from n and r. Use a recursive implementation of factorial.
The formula for the number of permutations of n things taken r at a time is:
P(n, r) = (n!) / (n - r)!
Member
Posts: 3,939
Joined: Feb 1 2013
Gold: 2,749.09
Warn: 20%
Oct 11 2016 01:23pm
there's two parts to your homework. which part do you not get?
Member
Posts: 4,729
Joined: Apr 4 2008
Gold: 596.00
Oct 11 2016 06:16pm
Quote (boxboxbox @ Oct 11 2016 11:23am)
there's two parts to your homework. which part do you not get?



I just won't have time tonight after work to finish it in time .
Member
Posts: 4,729
Joined: Apr 4 2008
Gold: 596.00
Oct 11 2016 08:24pm
1k FG for this
Member
Posts: 6,953
Joined: Sep 27 2003
Gold: 518.50
Oct 13 2016 05:13pm
Are you asking for someone to define a factorial function?

Code
unsigned long factorial(unsigned long n)
{
return n < 2 ? 1 : n*factorial(n-1);
}
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll