summaryrefslogtreecommitdiff
path: root/6p3.cpp
diff options
context:
space:
mode:
Diffstat (limited to '6p3.cpp')
-rw-r--r--6p3.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/6p3.cpp b/6p3.cpp
new file mode 100644
index 0000000..b653289
--- /dev/null
+++ b/6p3.cpp
@@ -0,0 +1,24 @@
+#include <iostream>
+
+/*
+ *
+ * 6.3
+ *
+ *
+ */
+
+int fact(int val) {
+
+ int ret = 1;
+ while(val > 1) {
+ ret *= val--;
+ }
+
+ return ret;
+}
+
+int main () {
+
+ std::cout << fact(5) << std::endl;
+ return 0;
+}