summaryrefslogtreecommitdiff
path: root/test/factorial2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/factorial2.c')
-rw-r--r--test/factorial2.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/factorial2.c b/test/factorial2.c
new file mode 100644
index 0000000..867b709
--- /dev/null
+++ b/test/factorial2.c
@@ -0,0 +1,7 @@
+int main (int argc, char** argv) {
+ int result = 1;
+ for (int n = argc; n; n = n - 1) {
+ result = result * n;
+ }
+ return result;
+}