int fact(int digit) { int a = 1; for (int i = 1; i < digit; a *= ++i); return a; }