Current location - Training Enrollment Network - Mathematics courses - Factorial process of natural numbers
Factorial process of natural numbers
Step 1: Let S = 1 and I = 1.

Step 2, enter a positive integer n corresponding to the factorial to be calculated.

Step 3 let s=s*i, i=i+ 1.

Step 4, judge whether I is greater than n, and if so, print out S.

Otherwise, return to the third step.

s= 1 i= 1? Enter n? when I

Find the factorial problem of n by recursively calling the function, and put an integer. ...

The algorithm described in the for statement is as follows:

Enter n; t:= 1; ? For i:= 1 to n do

begin T:= T * I; ? Output test

Extended data:

Universal factorial symbol was first put forward by French mathematician Kramp (C C.) in 1808, and then became popular at the initiative of German mathematician and physicist georg ohm (M.) and others, and it has been used ever since.

For example, if the required number is n, the factorial formula is 1×2×3××n, and the product obtained is x, that is, the factorial of n. ..

Baidu encyclopedia-factorial