fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int fact=1,i,n;
  5. scanf("%d",&n);
  6.  
  7. for(i=n;i>=1;i--)
  8. fact=fact*i;
  9.  
  10. printf("the factorial=%d",fact);
  11. }
  12.  
  13.  
Success #stdin #stdout 0.01s 5316KB
stdin
5
stdout
the factorial=120