aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/50_recursion_test1.sy
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/50_recursion_test1.sy')
-rw-r--r--tests/functional/50_recursion_test1.sy14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/functional/50_recursion_test1.sy b/tests/functional/50_recursion_test1.sy
new file mode 100644
index 0000000..e5fae44
--- /dev/null
+++ b/tests/functional/50_recursion_test1.sy
@@ -0,0 +1,14 @@
+int fact(int n) {
+ if (n == 0) {
+ return 1;
+ }
+ int nn;
+ nn = n-1;
+ return (n * fact(nn));
+}
+
+int main() {
+ int n;
+ n = 4;
+ return fact(n);
+}