Computer Science, asked by ruby932, 1 month ago

write a program to print k where k=m!+n!/(m-n)!×r!

Plz Ans first and do not spam!​

Answers

Answered by HarishAS
3

\underline{\tt{Program}}: \\ \\ \texttt{import math} \\ \\ \tt{m=int(in put('Enter\ the\ value\ of\ m :\ '))} \\ \\ \tt{n=int(in put('Enter\ the\ value\ of\ n :\ '))} \\ \\ \tt{r=int(in put('Enter\ the\ value\ of\ r :\ '))} \\ \\ k = ((math.factorial(m) + math.factorial(n))/((math.factorial(m-n)) * math.factorial(r)) \\ \\ \texttt{print('The value of k is: ' , k)}

Explanation :

We are getting the values of m , n , r as input form the user and k is given the formula as given in the question. Then value of k is printed.

Hope this helps : )

Similar questions