num=int(input("Enter an integer to find factorial : "))
fact=1
if num<0
:
print("Factorial of negative numbers does not exist.")
elif num==0:
print("Factorial of 0 is 1.")
elif num==1:
print("Factorial of 1 is 1.")
else:
for i in range(1,num+1):
fact=fact*i
print("Factorial of ",num," is ",fact)
No comments:
Post a Comment