Question
Find factorial of a number entered by user.
Answer :
Word Count : 304
__________ ___ __________ ____ _____ __________ ________ ___ ____.
___ ________ __________ _______ _____ _______ __________ _______ __________ _____.
_________ ________ ________ __________ _______.
___ ______ ________ ______ __________ __________ _____ _____.
____ _______ _______ _________ ________.
__________ ___ ______ ____ __________ _____ ______.
_______ _______ _______ _____ ______ ______ __________ __________ ________ _________ ____.
___ _________ _______ ______ ________ _________ _____ ______ _________ __________ _______.
______ _________ ________ ______ ___ _______.
________ ______ ______ ___ ___ ____ _______.
____ ____ ____ _________ ________ _________ ______.
_____ ________ _________ __________ __________ _______ _________ _________.
___ ______ ____ ________ __________.
_______ ________ ______ ______ ________ ________ _________ ______ __________ ________ _________ ______.
_____ ___ ___ ________ _____ ______ _____ _______ __________.
____ ________ _____ ______ ________ ____ _______ ________ ______ __________ ______ ______.
____ __________ ______ ______ __________ __________ _________ _____ ____ _____ __________.
____ __________ _______ ________ ______ ___ ____ ____ _________ ________ _________ ________.
____ ____ ________ ______ ________ ________ _____ _______ ___ ________ ____ __________.
______ _____ ________ ______ ___ _____ ________ _______ ___.
__________ _____ _________ ____ _______.
______ _______ ______ __________ ______ ____ __________.
Skip in 10
To find the factorial of a number entered by the user, you can use the following algorithm:
- Read the number entered by the user and store it in a variable, let's say
number. - Initialize a variable
factorialto 1. This variable will hold the factorial value. - Use a loop to calculate the factorial. Start the loop from
numberand decrement it by 1 in each iteration until it reaches 1. - Multiply
factorialby the current value ofnumberin each iteration and update the value offactorial. - After the loop ends, the value of
factorialwill be the factorial of the entered number. - Display the factorial value to the user.
def factorial(number):
___ ________ __________ _______ _____ _______ __________ _______ __________ _____.
_________ ________ ________ __________ _______.
___ ______ ________ ______ __________ __________ _____ _____.
____ _______ _______ _________ ________.
__________ ___ ______ ____ __________ _____ ______.
_______ _______ _______ _____ ______ ______ __________ __________ ________ _________ ____.
___ _________ _______ ______ ________ _________ _____ ______ _________ __________ _______.
______ _________ ________ ______ ___ _______.
________ ______ ______ ___ ___ ____ _______.
____ ____ ____ _________ ________ _________ ______.
_____ ________ _________ __________ __________ _______ _________ _________.
___ ______ ____ ________ __________.
_______ ________ ______ ______ ________ ________ _________ ______ __________ ________ _________ ______.
_____ ___ ___ ________ _____ ______ _____ _______ __________.
____ ________ _____ ______ ________ ____ _______ ________ ______ __________ ______ ______.
____ __________ ______ ______ __________ __________ _________ _____ ____ _____ __________.
____ __________ _______ ________ ______ ___ ____ ____ _________ ________ _________ ________.
____ ____ ________ ______ ________ ________ _____ _______ ___ ________ ____ __________.
______ _____ ________ ______ ___ _____ ________ _______ ___.
__________ _____ _________ ____ _______.
______ _______ ______ __________ ______ ____ __________.
IGNOU ACADEMY
Your IGNOU journey, made easier.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
Continue Reading — It's Free
Sign in with Google to unlock more of this answer.
✓ Free access
✓ Unlock up to 60% of the answer
✓ No payment required
✓ Unlock up to 60% of the answer
✓ No payment required
Quick Google sign-in. No separate registration form.