Site icon TestingDocs.com

Raptor flowchart to find Factorial of a number

Overview

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

Pseudocode

/**
* NAME:
* DATE:
* FILE:
* COMMENTS:
*/

START
number = 0;
fact = 1;
PROMPT “Enter positive number to calculate factorial:”;
INPUT number;
PRINT “Entered number is=” + number;
WHILE (number <= 1)
{
fact = fact * number;
number = number – 1;
}
PRINT “Factorial of the number is =” + fact;
END

Flowchart

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

fact is the variable to calculate the factorial. This is multiplied in a repetition structure.

Input/Output

Input for the flowchart is prompted using the Input Symbol.

The output from the flowchart is displayed using the Output symbol.

https://www.testingdocs.com/raptor-flowchart-basics-input-and-output/

Java Program

https://www.testingdocs.com/questions/java-program-to-compute-the-factorial-of-given-number/

 

More Flowchart Examples

https://www.testingdocs.com/raptor-flowchart-examples/

Raptor Tutorial

Raptor Tutorials on this website can be found at:

https://www.testingdocs.com/raptor-a-flowchart-tool/

RAPTOR official website: https://raptor.martincarlisle.com/

Exit mobile version