fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int i=1;
  6. int n;
  7. int f;
  8.  
  9. printf("enter an integer\n");
  10. scanf(" %d ", &n);
  11.  
  12. for(i=1; i<=n; i++)
  13. {
  14. f = f * i;
  15. }
  16. printf("Factorial of %d! = %d\n", n, f);
  17.  
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 10320KB
stdin
10
stdout
enter an integer
Factorial of 10! = 0