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

16 lines
165 B
Text
Raw Normal View History

2018-09-18 22:50:15 -04:00
% 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;