Factorial with recursion

Back

//Factorial with recursion

#include stdio.h
#include conio.h
long int find_factorial(long int n)
{
if(n<=1)
return 1;
else
return (n* find_factorial(n-1));
}
int main(void)
{
long int x,n;
scanf("%ld",&n);
x=find_factorial(n);
printf("factorial is : %ld\n",x);
return 0;
}

No comments:

Post a Comment

Followers

About Me

Dhaka, Dhaka, Bangladesh
..