Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in C Programming by (55.6k points)
recategorized by
Can anyone explain the recursion in C?

1 Answer

0 votes
by (119k points)

In programming, recursion is a function calling itself using the iterative approach to perform complex tasks. Here is an example to write recursive function in C:

void recursion() {

   recursion(); /* function calls itself */

}

int main() {

   recursion();

}

The C language supports recursion but you need to define an exit condition while defining recursion, otherwise it will go into an infinite loop.

Recursive functions are used for calculating the factorial of a number, generating the Fibonacci series, etc.

If you want to learn C programming, then check out this C Certification program by Intellipaat.

Also, watch this YouTube tutorial on C programming:

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...