Lesson 23 of 50
cRecursive Functions
9 mins
Course progress46%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 23 of 50
c9 mins
Keep these ideas in mind as you work through the lesson.
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);
}