diff options
| author | Asahel <[email protected]> | 2024-02-01 20:25:57 -0800 |
|---|---|---|
| committer | Asahel <[email protected]> | 2024-02-01 20:25:57 -0800 |
| commit | 5386e38e57a9f71add6145636803b059431be563 (patch) | |
| tree | efa1feed70af1eaa9237c5a5546f9c01a3d5fe9c /Homework3/recursive.cpp | |
| parent | Started and entered files (diff) | |
| download | homework-3-asahellt-5386e38e57a9f71add6145636803b059431be563.tar.xz homework-3-asahellt-5386e38e57a9f71add6145636803b059431be563.zip | |
Added recursive.cpp and recursive.h
Implemented Fib function
Diffstat (limited to 'Homework3/recursive.cpp')
| -rw-r--r-- | Homework3/recursive.cpp | 10 |
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 |