Raptor flowchart to find Factorial of a number
In this tutorial, we will design the Raptor flowchart to find the factorial of a number. Factorial of a number is mathematically defined as follows:
n! = n*(n-1)*(n-2)… * 1
number = 0;
fact = 1;
PROMPT “Enter positive number to calculate factorial:”;
PRINT “Entered number is=” + number;
WHILE (number <= 1)
fact = fact * number;
number = number – 1;
PRINT “Factorial of the number is =” + fact;
We will use two variables in the flowchart. One variable number to calculate the factorial. We will prompt the number from the user. The variables are initially assigned to
- number is assigned to 0
- fact is assigned to 1.
fact is the variable to calculate the factorial. This is multiplied in a repetition structure.
Input for the flowchart is prompted using the Input Symbol.
The output from the flowchart is displayed using the Output symbol.
More Flowchart Examples
Raptor Tutorials on this website can be found at:
RAPTOR official website: https://raptor.martincarlisle.com/