fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n, pro;
  5. scanf("%d",&n);
  6. pro = 1;
  7. while (n>=1) {
  8. pro = pro*n;
  9. n = n-1;
  10. }
  11. printf("product = %d\n",pro);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5324KB
stdin
7
stdout
product = 5040