fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n;
  5. printf("Enter the number: \n");
  6. scanf("%d",&n);
  7.  
  8. int product= 1;
  9.  
  10. for(int i=1;i<=n;i++){
  11. product= product*i;
  12. }
  13. printf(" Factorial is %d",product);
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5288KB
stdin
5
stdout
Enter the  number: 
 Factorial is 120