Saturday, 28 August 2021

Python Program : 10 : Compute factorial of a given number.

PROGRAM :-
import math
FACT = 1
n = int(input("Enter any integer value : "))
if n>0:
    for i in range(1,n+1):
        FACT = FACT * i
    print("Factorial of",n,"is:",FACT)
elif n==0:
    print("Factorial of 0 is 1")
else:
    print("Please enter + ve value")

VIDEO LINK : -

No comments:

Post a Comment

Note: only a member of this blog may post a comment.