C Programming
Computer Programming

C Program using function to Find Factorial of a Number



Write a Program in C using function to Find Factorial of a Number

\* C Program using function to Find Factorial of a Number *\

# include < stdio.h >
# include < conio.h >
int   factorial(int) ;

int   main( )
{

int n, fact = 0 ;
printf(" Enter the Number to find the factorial : ") ;
scanf("%d", &n) ;

fact = factorial(n) ;
printf("\n Factorial number is : %d ", fact) ;
return (0) ;

}

int   reverse(int n)
{

int f = 1 ;
for ( int i = n; i >0 ; i-- )
{
    f = f * i ;
}
return (f) ;

}

Output of Program :

Output of C Program using function to Find Factorial of a Number