What is recursion in C?
Recursion: A function, which calls itself, recursion is simple to write in the program but takes more memory space and time to execute.
Advantages of using recursion:-
Avoid unnecessary calling of functions
Substitute for iteration
Useful when applying the same solution
Factorial program in c using Recursion
int factorial(unsigned int i)
if(i <= 1)
return i * factorial(i - 1);
int i = 15;
printf("Factorial of %d is %d\n", i, factorial(i));