Factorial Flowchart using Recursion
Factorial Flowchart using Recursion
- n!=n×(n−1)×(n−2)×…×1
- n! = n×(n-1)!
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: