aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/recursive_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/recursive_functions.c')
-rw-r--r--tests/recursive_functions.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/recursive_functions.c b/tests/recursive_functions.c
new file mode 100644
index 0000000..b81824a
--- /dev/null
+++ b/tests/recursive_functions.c
@@ -0,0 +1,13 @@
+#include <helpers.h>
+
+int fib(int n) {
+ if (n <= 1) {
+ return 1;
+ } else {
+ return fib(n - 1) + fib(n - 2);
+ }
+}
+
+int main() {
+ ASSERT_EQ(89, fib(10));
+}