From 944e0b9f85290414efcc1e0a278698bce930bbe2 Mon Sep 17 00:00:00 2001 From: zeekling Date: Fri, 31 Jul 2020 21:18:15 +0800 Subject: [PATCH] add print_a.c --- c_expert/chapter6/print_a.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 c_expert/chapter6/print_a.c diff --git a/c_expert/chapter6/print_a.c b/c_expert/chapter6/print_a.c new file mode 100644 index 0000000..b7a843f --- /dev/null +++ b/c_expert/chapter6/print_a.c @@ -0,0 +1,17 @@ +#include + + +void a(int i) +{ + if (i > 0) + a(--i); + else + printf("i has reached zero \n"); + return; + +} + +int main(){ + a(1); + return 0; +}