1
0

06_invfactorial.c 298 B

123456789101112131415161718
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int factorial = 3628800;
  5. int n = 1;
  6. int tmpfact = 1;
  7. while (tmpfact < factorial)
  8. {
  9. tmpfact *= n;
  10. n++;
  11. }
  12. if (tmpfact == factorial)
  13. printf("%d is a factorial of %d\n", factorial, n - 1);
  14. else
  15. printf("%d is not a factorial\n", factorial);
  16. return 0;
  17. }