How would you write a non-recursive algorithm to compute n!?
n!
long fact(int n) { long x = 1; for(int i = 1; i <= n; i++) { x *= i; } return x; }