Advertisement
mustahidhasan

factroial

Feb 20th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6.  
  7.  
  8.  
  9.     int n, i, factorial = 1;
  10.     scanf("%d", &n);
  11.  
  12.     for(i = n; i >= 1; i--)
  13.     {
  14.         factorial = factorial * i;
  15.     }
  16.     printf("%d", factorial);
  17.  
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement