{ A destination to learn coding }

Finding factorial of a number


#include < stdio.h >
int main()
{
    int a,n;
    float fact=1;
    printf("Enter a number to find its factorial\n");
    scanf("%d",&a);

    for(n=a;n > 1;n--)
    {
        fact*=n;
    }
    printf("The factorial of %d is %f",a,fact);

    return 0;
}