#include int main() { int num, product; num = 1; product = 1; /* Note - start product at 1 not 0 */ while(num <= 7) { product = product *num; /* we could also write product *= num; */ num = num + 1; } /* Note that num will be 8 when we get to this point */ printf("Factorial of 7 = %d\n", product); return 0; }