Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main()
  4. {
  5.   int n, i, f;
  6.  
  7.  
  8.   scanf("%d", &n);
  9. if(0 <= n && n <=12)
  10. {
  11.   f = 1;
  12. for(i=1;i<=n;i++)
  13. {
  14.  
  15.     f = f * i;
  16.                    
  17.   }
  18.  
  19.   printf("%d \n",f);
  20. }
  21. else
  22. {
  23.     printf("valor invalido \n");
  24. }
  25.  
  26. return(0);
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement