aboutsummaryrefslogtreecommitdiff
path: root/Homework3/recursive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Homework3/recursive.cpp')
-rw-r--r--Homework3/recursive.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Homework3/recursive.cpp b/Homework3/recursive.cpp
new file mode 100644
index 0000000..281ccd9
--- /dev/null
+++ b/Homework3/recursive.cpp
@@ -0,0 +1,10 @@
+#include "recursive.h"
+
+
+
+long factorial(int a)
+{
+ if (a == 1 || a == 0) return 1;
+
+ return a * factorial(a - 1);
+} \ No newline at end of file