Recursion in C ?


A recursion is a method of solving the problem where the solution to a problem depends on solution to seller instances of the same problem. A recursive function is a function that calls itself during execution. This enables the function to repeat itself several times to solve a given problem.


Example of recursion
void main()
{
printf("ok\n");
main();
}
Output
ok
ok
ok
ok
ok
....
....
....