Question

Find factorial of a number entered by user. 

27 Apr 2023
Answer :
Word Count : 304

To find the factorial of a number entered by the user, you can use the following algorithm:

  1. Read the number entered by the user and store it in a variable, let's say number.
  2. Initialize a variable factorial to 1. This variable will hold the factorial value.
  3. Use a loop to calculate the factorial. Start the loop from number and decrement it by 1 in each iteration until it reaches 1.
  4. Multiply factorial by the current value of number in each iteration and update the value of factorial.
  5. After the loop ends, the value of factorial will be the factorial of the entered number.
  6. 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
Skip in 10
Top
📞
Call Support Instant phone assistance IGNOU MCS 201 2023 - Find factorial of a number entered by user.  | IGNOU Academy
→
🟢
WhatsApp Chat Fast live messaging
→
Email Us Business enquiries & support
→