Factorial Flowchart using Recursion
Factorial Flowchart using Recursion
The factorial of an integer n is denoted as n! Factorial is the product of all positive integers less than or equal to n. For example:
-   n!=n×(n−1)×(n−2)×…×1
or
- n! = n×(n-1)!
For n=0, the factorial is defined as 0!=1
Example
5!=5×4×3×2×1=120
In this tutorial, we will design a flowchart to compute the factorial of a number using Recursion.
factorial() is a recursive function. The Main flowchart calls this function to compute the factorial of the given number.
The function calls itself for recursive cases. Since the factorial of 1! =1, the function returns 1 as the base case when n==1.
fact = n*factorial(n-1)
Output
Run the flowchart and verify its output.
—
Flowgorithm Tutorials
Flowgorithm flowchart tutorials on this website:
Flowgorithm Website
For more information on the Flowgorithm tool, please visit the official website at: