From 0a62110780dc9b4cb30175146cc0c6da1f69fdfd Mon Sep 17 00:00:00 2001 From: NotAishik <53148646+NotAishik@users.noreply.github.com> Date: Thu, 17 Oct 2019 19:36:39 +0530 Subject: [PATCH] Create aishik.cpp --- aishik.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 aishik.cpp diff --git a/aishik.cpp b/aishik.cpp new file mode 100644 index 0000000..5b713a1 --- /dev/null +++ b/aishik.cpp @@ -0,0 +1,18 @@ +//Fibonacci Series using Recursion +#include +using namespace std; + +int fib(int n) +{ + if (n <= 1) + return n; + return fib(n-1) + fib(n-2); +} + +int main () +{ + int n = 9; + cout << fib(n); + getchar(); + return 0; +}