Triangle tools from the text book Programming Processors in Java.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Triangle-Tools/programs/factorials.tri

15 lines
225 B

let
func factorial (n: Integer): Integer ~
if n <= 1
then 1
else n * factorial (n-1);
var i: Integer
in
begin
getint (var i);
putint (i); put ('!');
put (' '); put ('='); put (' ');
putint (factorial (i))
end