summaryrefslogtreecommitdiff
path: root/test/factorial.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/factorial.c')
-rw-r--r--test/factorial.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/factorial.c b/test/factorial.c
new file mode 100644
index 0000000..0525b8f
--- /dev/null
+++ b/test/factorial.c
@@ -0,0 +1,8 @@
+int fact (int n) {
+ if (n) return n * fact(n-1);
+ else return 1;
+}
+
+int main (int argc, char** argv) {
+ return fact(argc);
+}