summaryrefslogtreecommitdiff
path: root/Ganlib/data/testgan1_proc/xfact.c2m
diff options
context:
space:
mode:
Diffstat (limited to 'Ganlib/data/testgan1_proc/xfact.c2m')
-rw-r--r--Ganlib/data/testgan1_proc/xfact.c2m14
1 files changed, 14 insertions, 0 deletions
diff --git a/Ganlib/data/testgan1_proc/xfact.c2m b/Ganlib/data/testgan1_proc/xfact.c2m
new file mode 100644
index 0000000..0b68171
--- /dev/null
+++ b/Ganlib/data/testgan1_proc/xfact.c2m
@@ -0,0 +1,14 @@
+*
+* Calling the recursive "fact" procedure:
+*
+* input to "fact": *n*
+* output from "fact": *n_fact*
+*
+* use to compute n!
+*
+ PROCEDURE fact ;
+ INTEGER n := 8 ;
+ INTEGER n_fact ;
+ fact :: <<n>> >>n_fact<< ;
+ ECHO "FACTORIAL:" n $Bang_S "=" + n_fact ;
+ QUIT " Program *xfact* XREF " .