/*factorial.c - Copyright (c) 1998 Matthew Belmonte.*/ /*the same, but counting up to n instead of down to 0*/ int main() { register int count; int n; long factorial; printf("Compute the factorial of what number? "); scanf("%d", &n); factorial = 1L; count = 1; while(count <= n) factorial *= count++; printf("%d! = %ld\n", n, factorial); return 0; }