How would you write a non-recursive algorithm to compute n!?
n!
For a non-recursive approach, it can't get simpler than this
int fac(int num) { int f = 1; for (int i = num; i > 0; i--) f *= i; return f; }