, . , :
int factorial (int x)
{
int i;
for (i = 1; i < x; i++)
x *= i;
return x;
}
1:
, int factorial (...) - , , factorial, int. int x - , , x int. , , .
3:
, int. , , , .
4:
, i, 3, . i=1 , 1. i<x , , x. i++ , , , .
5:
x*=1 , x i. , . , , x 5, i, 1, 2, 3 4 ( 1 , x), x 1, 2, 3 4. , x 5 * 1 * 2 * 3 * 4, 5.
6:
x , , return - ββ x ( 5 , ).
:
int f;
f = factorial(5);
x 5 f (, - 5 * 1 * 2 * 3 * 4)