Add C example for recursion (#41)

This commit is contained in:
kde0820
2017-11-14 01:11:41 +09:00
committed by Aditya Bhargava
parent 38d50415e8
commit b88af07fd0
3 changed files with 57 additions and 0 deletions

23
03_recursion/c/02_greet.c Normal file
View File

@@ -0,0 +1,23 @@
#include <stdio.h>
void greet2(char *name) {
printf("how are you, %s?\n", name);
}
void bye() {
printf("ok bye!\n");
}
void greet(char *name) {
printf("hello, %s!\n", name);
greet2(name);
printf("getting ready to say bye...\n");
bye();
}
int main(void) {
greet("adit");
return 0;
}