#include <stdio.h> int factorial(int n) { int ret = 1; for (; n > 1; n--) { ret *= n; } return ret; } int main() { int i; for (i = 0; i <= 10; i++) { printf ("%d! = %d\n", i, factorial(i)); } return 0; }