What is recursion?

Last updated on June 13th, 2020 at 08:26 pm




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.

Leave a Reply

Your email address will not be published. Required fields are marked *