#include<stdio.h>

long int fact(int p);
main() {
  long int k;
  int n;
  printf("enter n\n");
  scanf("%d", & n);

  printf("the factorial of %d is=%ld", n, fact(n));
}
long int fact(int p) {
  if (p == 0) {
    return 1;
  } else {

    return p * fact(p - 1);
  }
}
     
           
Note: Need to be arranged in compiler after copied
   

 OutPut:

enter n 5 the factorial of 5 is=120