CBSE Class 11 Computer Science
Question 48 of 80
Getting Started with Python — Question 13
Back to all questionsStep 1: Start
Step 2: Input the number "n" from the user.
Step 3: Initialize a variable "fact" to 1.
Step 4: If n is 0, then the factorial is 1 and go to Step 7.
Step 5: If "n" is greater than 0, multiply "fact" by each integer from 1 to "n" in sequence.
Step 6: The final value of "fact" is the result.
Step 7: Display "fact".
Step 8: End