Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 13 / task1.cpp
diff options
context:
space:
mode:
1 files changed, 15 insertions, 0 deletions
-rw-r--r--Sem. 13/task1.cpp15
diff --git a/Sem. 13/task1.cpp b/Sem. 13/task1.cpp
new file mode 100644
index 0000000..bd2ce93
--- /dev/null
+++ b/Sem. 13/task1.cpp
@@ -0,0 +1,15 @@
+#include <iostream>
+using namespace std;
+
+unsigned fact(unsigned n)
+{
+ if (n == 0)
+ return 1;
+
+ return n * fact(n - 1);
+}
+
+int main()
+{
+ cout << fact(5);
+} \ No newline at end of file