English

Write pseudocode to calculate the factorial of a number (Hint: Factorial of 5, written as 5! = 5 × 4 × 3 × 2 × 1). - Computer Science (Python)

Advertisements
Advertisements

Question

Write pseudocode to calculate the factorial of a number (Hint: Factorial of 5, written as 5! = 5 × 4 × 3 × 2 × 1).

Short Note

Solution

Input number
Set Factorial = 1
For i in range ( 1, number + 1) :
       Factorial *= I

Print factorial
shaalaa.com
Representation of Algorithms - Pseudocode
  Is there an error in this question or solution?
Chapter 4: Introduction to Problem Solving - Exercise [Page 85]

APPEARS IN

NCERT Computer Science [English] Class 11
Chapter 4 Introduction to Problem Solving
Exercise | Q 15. | Page 85
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×