int main(void) { int i = 1, fact = 1; while (fact <= 1000) { fact *= i; printf("%d! = %d\n", i, fact); i++; } return 0; }