num=int(input("Enter a num>>"))
factorial=1
if num<0:
print("sorry, Factorial does not exiat for negative number")
elif num == 0:
print("The factorial of 0 is 1")
else:
for i in range(1,num+1):
factorial=factorial*i
print("The factorial of",num,"is",factorial)
Output:-
Enter a num>>12
The factorial of 12 is 479001600
0 Comments