Lesson 23 of 50 · c
Recursive Functions
Duration: 9 mins
A function is recursive when it calls itself. Each call creates a new stack frame with its own local variables.
int fact(int n) {
if (n <= 1) return 1;
return n * fact(n-1);
}
Lesson 23 of 50 · c
Duration: 9 mins
A function is recursive when it calls itself. Each call creates a new stack frame with its own local variables.
int fact(int n) {
if (n <= 1) return 1;
return n * fact(n-1);
}