#include <stdio.h>
void countDown(int n) {
if (n <= 0) {
printf("Countdown complete!\n");
} else {
printf("%d\n", n);
countDown(n - 1); // Recursive call
}
}
int main() {
int start = 5;
countDown(start);
return 0;
}
/*
Recursion is a concept in programming where a function calls itself. It's like a
loop, but instead of repeating a block of code, the function calls itself to solve
a smaller part of the problem.*/
To embed this program on your website, copy the following code and paste it into your website's HTML: