C-programming - Factorial, C program to find factorial

Factorial

This program calculates factorial of a number. The number can also be got as input at run time by including scanf statement.

#include<stdio.h>
#include<conio.h>
int main()
{
    int i,a,fact=1,even=0;
    for(i=5; i>1; i--)
    {
        fact*=i;
    }
    printf("factorial of the no is %d",fact);    
    getch();
}


output


factorial of the no is 240

The topic on C-programming - Factorial is posted by - Math

Hope you have enjoyed, C-programming - FactorialThanks for your time

Tech Bluff