fork download
  1. #include <stdio.h>
  2.  
  3. unsigned long long factorial(int n)
  4. {
  5. return (n > 0) ? (n * factorial(n - 1)) : 1;
  6. }
  7.  
  8. int main(void)
  9. {
  10. int n = 6;
  11. printf("%d! = %Lu\n", n, factorial(n));
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
6! = 720