Archived
1
0
Fork 0
This repository has been archived on 2023-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
SLOTH/examples/fact.sl

15 lines
165 B
Text

% program to calculate factorials
% get input
x := input;
fact := 1;
% a loop!
while x > 1.0 do begin
fact := fact * x;
x := x - 1;
end
% output
print fact;