The factorial of an integer, number
, greater than or equal to 0, can be calculated iteratively (nonrecursively) by using a for
statement as follows:
factorial = 1;
for ( unsigned int counter = number; counter >= 1; --counter )
factorial *= counter;
3.15.18.61