A Non-recursive Factorial Function
int fact(int n)
{
int k, prod;
prod = 1;
for(k=1; k<=n; ++k){
prod = prod * k;
}
return prod;
}
Previous slide
Next slide
Back to first slide
View graphic version