Last active
December 3, 2019 12:50
-
-
Save kuntalchandra/ac583ac9d9965642ccdc009b7c45e86a to your computer and use it in GitHub Desktop.
How does recursion work. Guess the output :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void print_recursive(int n); | |
int main() { | |
print_recursive(7); | |
} | |
void print_recursive(int n) { | |
if (n <= 0) { | |
return; | |
} else { | |
n--; | |
} | |
print_recursive(n); | |
printf("n is: %d\n", n); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment