Python Program to Calculate Factorial of Given Number Using While Loop

Python Program to Calculate Factorial of Given Number Using While Loop 


print("Python program to calculate Factorial of Given Number")

n=int(input("Enter Number to calculate Factorial:"))

fact=1

i=1

while i<=n:

  fact=fact*i

  i=i+1

print(f"Factorial of {n} is: {fact}") 

print("End of Program")


Output:

Python program to calculate Factorial of Given Number

Enter Number to calculate Factorial:5

Factorial of 5 is: 120

End of Program

टिप्पणी पोस्ट करा

0 टिप्पण्या