C program to find the factorial of the inputted number

C program to find the factorial of the inputted number



#include
void main()
{
     int n,i,fact=1;

     printf("Please Enter any number\n");
     scanf("%d",&n);

     for(i=n;i>=1;i--)
     {
                      fact=fact*i;
     }
     printf("\n factorial = \t %d",fact);
     getch();
     }


No comments:

Post a Comment