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

There was an error in this gadget

Followers

About Me

Dhaka, Dhaka, Bangladesh
..