What is recursion?

Author: Tanmay Chakrabarty

First Published On: Monday, April 13, 2015 at 1:46 PM
About:




Recursion : Recursion is a special case where a function calls itself. A very simple example of recursion is presented below,






main(){
 printf(“This is an example of recursion.\n”);
 main();
 }

When executed this program will produce an output which is something like this,

This is an example of recursion.
This is an example of recursion.
This is an example of recursion.
...
...

Execution is terminated abruptly; otherwise the execution will continue indefinitely.

Recommended

Comments

Contact Us

Author