Write a program to Recursively find …
CBSE, JEE, NEET, CUET
Question Bank, Mock Tests, Exam Papers
NCERT Solutions, Sample Papers, Notes, Videos
Posted by Vivek Vaish 4 years, 4 months ago
- 1 answers
Related Questions
Posted by Hanni Pham 4 months, 1 week ago
- 1 answers
Posted by Kandeepan Jothivel 6 months, 3 weeks ago
- 2 answers
Posted by Hanni Pham 4 months, 1 week ago
- 0 answers
Posted by Syedali Fathima 5 months, 3 weeks ago
- 1 answers
Posted by Prawar Narang 6 months, 2 weeks ago
- 1 answers
Posted by Manoj Kumar Manoj Kumar 7 months, 2 weeks ago
- 0 answers
Posted by Priya Shukla 5 months, 2 weeks ago
- 1 answers
myCBSEguide
Trusted by 1 Crore+ Students
Test Generator
Create papers online. It's FREE.
CUET Mock Tests
75,000+ questions to practice only on myCBSEguide app
Gaurav Seth 4 years, 4 months ago
def recur_factorial(n):
if n == 1:
return n
else:
return n*recur_factorial(n-1)
# take input from the user
num = int(input("Enter a number: "))
# check is the number is negative
if num < 0:
print("Sorry, factorial does not exist for negative numbers")
elif num == 0:
print("The factorial of 0 is 1")
else:
print("The factorial of",num,"is",recur_factorial(num))
1Thank You