C program to find the factorial of given number | Factorial of number in C

C program to find the factorial of given number | Factorial of number in C | Assignment to find factorial in C Programming




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

     printf("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