From 6ba7e8efcd800adf5d3bbc0c4113d2d3a3670ddb Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Sun, 9 Feb 2014 01:05:03 +0100 Subject: [PATCH] new sample - Recursive Factoriel --- samples/RekFac.mj | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 samples/RekFac.mj diff --git a/samples/RekFac.mj b/samples/RekFac.mj new file mode 100644 index 0000000..40817fd --- /dev/null +++ b/samples/RekFac.mj @@ -0,0 +1,15 @@ +program RekFac{ + + int factorial(int f) + { + if (f<0) return 0; + if (f<=1) return 1; + return factorial(f-1) * f ; + } + + void main() + { + print(factorial(3),3); + print(factorial(10),10); + } +} \ No newline at end of file -- 2.25.1