Answers for "how to find factorial"

C++
0

program to calculate factorial of a number

#include<stdio.h>  
int main()    
{    
 int i,fact=1,number;    
 printf("Enter a number: ");    
  scanf("%d",&number);    
    for(i=1;i<=number;i++){    
      fact=fact*i;    
  }    
  printf("Factorial of %d is: %d",number,fact);    
return 0;  
}
Posted by: Guest on October-31-2021

Code answers related to "how to find factorial"

Browse Popular Code Answers by Language