/*factorial.c - several versions of a factorial program. Copyright (c) 1998 Matthew Belmonte.*/
int main()
{
int n;
long factorial;
printf("Compute the factorial of what number? ");
scanf("%d", &n);
factorial = 1L;
while(n > 0)
factorial *= n--;
printf("The factorial is %ld\n", factorial); return 0;
}
/*the same, but counting up to n instead ...