fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n = 0, k = 1, f = 1;
  5. scanf("%d", &n);
  6. if (n > 0) {
  7. while (n >= k) {
  8. f = f * k;
  9. k = k + 1;
  10. }
  11. printf("%d", f);
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5268KB
stdin
5
stdout
120