We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 513070d commit ed5dc3aCopy full SHA for ed5dc3a
src/cpp/FibonacciRecursive.cpp
@@ -0,0 +1,25 @@
1
+
2
+#include <iostream>
3
4
+using namespace std;
5
6
+int fibonacciRecursive(int n)
7
+{
8
+ if (n == 0)
9
+ {
10
+ return 0;
11
+ }
12
+ else if (n == 1)
13
14
+ return 1;
15
16
+ else
17
18
+ return fibonacciRecursive(n-1) + fibonacciRecursive(n-2);
19
20
+}
21
22
+int main()
23
24
+ cout << fibonacciRecursive(12) << endl;
25
0 commit comments