+ 2 + 3 + 4) +
Input two integers N and M as the start and end limits. Print the factorial of all the integers between N and
M, if N<M, otherwise print a message "factorials not possible”. The factorial of N is given by : N! = N*
*** + n terms.
31.
(N-1) * (N-2) * (N-3) *
sengrate programs to find
Answers
Answered by
1
Answer:
Here you go,
___________________________________
def fact(a):
if n<=0:
return 1
else:
pr=1
for i in range(1,a+1):
pr*=i
return pr
N=int(input("Enter the upper range: "))
M=int(input("Enter the lower range: "))
if M>N:
print("Factorial not possible" )
elif N==0 and M==0:
p=1
else:
for i in range(M,N+1):
p= fact(i)
print("The factorial of", i," will be" ,p)
__________________
Similar questions