summaryrefslogtreecommitdiff
path: root/test/c/fib.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/c/fib.c')
-rw-r--r--test/c/fib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/c/fib.c b/test/c/fib.c
new file mode 100644
index 0000000..34e7baa
--- /dev/null
+++ b/test/c/fib.c
@@ -0,0 +1,7 @@
+int fib(int n)
+{
+ if (n < 2)
+ return 1;
+ else
+ return fib(n-1) + fib(n-2);
+}