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 c8c18fd commit 07d4935Copy full SHA for 07d4935
Progress.txt
@@ -19,4 +19,5 @@
19
30
20
31
21
32
22
-33
+33
23
+34
factorialRecursion.cpp
@@ -0,0 +1,14 @@
1
+#include <iostream>
2
+using namespace std;
3
+
4
+double factorial(int n) {
5
+ if (n == 0) {
6
+ return 1;
7
+ }
8
+ return n * factorial(n - 1);
9
+}
10
11
+int main() {
12
+ cout << factorial(9);
13
+ return 0;
14
fibonacciRecursion.cpp
@@ -0,0 +1,15 @@
+int fibonacci(int n) {
+ if (n == 0)
+ if (n == 1)
+ return fibonacci(n - 1) + fibonacci(n - 2);
+ cout << fibonacci(5);
15
0 commit comments