0

Please Help!!!I need answer with C or C++

(n!*m!)/!(m+n) n!=1 n=0 n!=1*2*3*....*(n-1)* for n>0

23rd Dec 2018, 3:28 PM
Thor Lines
2 Respuestas
+ 1
#include <iostream> using namespace std; long long fact(int n){ int i = n; long long fact = 1L; if(i != 0){ while(i > 0){ fact *= i; i--; } } return fact; } void compute (int n, int m){ double ans = (fact(n) * fact(m)) / fact(n+m); printf("%f",ans); } int main() { int n = 5; int m = 10; compute(n, m); return 0; } the code for your given problem is as above but are you sure this formula (n!*m!)/!(m+n) is correct?
25th Dec 2018, 9:02 AM
🇵🇰 Danish Khan 🇵🇰
🇵🇰 Danish Khan 🇵🇰 - avatar
0
Υες
25th Dec 2018, 10:13 AM
Thor Lines