Update manuals and other additions
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
% Introductory Manual 2026 - Figure 1 (Section 1.3)
|
||||
% Calculates the factorial of a number n.
|
||||
|
||||
SECTION factorial_demo;
|
||||
|
||||
TYPE integer {-32768 TO 32767};
|
||||
|
||||
DCL factorial PROC(n integer) RETURNS integer IS
|
||||
BLOCK
|
||||
DCL result, i integer;
|
||||
n -> i -> result;
|
||||
WHILE (i - 1 -> i) > 1
|
||||
DO
|
||||
i * result -> result;
|
||||
ENDDO;
|
||||
RETURN result;
|
||||
ENDBLOCK;
|
||||
Reference in New Issue
Block a user