☰
d2jsp
Rules
Help
Forum Gold FAQ
Live Streams
Photo Gallery
Hourly Raffle
Ladder Slasher
Log In
Register
Log In
Register
Account Recovery
Resend Validation Email
d2jsp Forums
>
Off-Topic
>
Computers & IT
>
Programming & Development
> Iso C++ Help > Ft Fg
Add Reply
New Topic
New Poll
Views: 324
Replies: 4
Track Topic
TonyAkACheif
Member
Posts: 4,729
Joined: Apr 4 2008
Gold
:
596.00
#1
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)!
boxboxbox
Member
Posts: 3,939
Joined: Feb 1 2013
Gold
:
2,749.09
Warn: 20%
#2
Oct 11 2016 01:23pm
there's two parts to your homework. which part do you not get?
TonyAkACheif
Member
Posts: 4,729
Joined: Apr 4 2008
Gold
:
596.00
#3
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 .
TonyAkACheif
Member
Posts: 4,729
Joined: Apr 4 2008
Gold
:
596.00
#4
Oct 11 2016 08:24pm
1k FG for this
ASBands
Member
Posts: 6,953
Joined: Sep 27 2003
Gold
:
518.50
#5
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
© 2003-2026 d2jsp
Contact