fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int s=1,i=1,n;
  6. scanf("%d",&n);
  7. while(i<=n)
  8. {s=s*i;
  9. i++;}
  10. printf("s=%d\n",s);
  11. return 0;
  12. }
  13.  
  14.  
Success #stdin #stdout 0s 5316KB
stdin
4
stdout
s=24