Advertisement
rafikamal

Find the Factorial

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