! Example program: compute and print N! for N=<0,...,9>.
! Note: results WILL overflow on 16-bit systems.
! Note2: TXX is always a 16-bit system.
! Compile with 'tx fac.t'

fac(n) return n=0-> 1: fac(n-1)*n;

do
	var	i;

	for (i=0,10) do
		writes("fac("); writes(ntoa(i,0)); writes(") = ");
		writes(ntoa(fac(i), 10)); newline();
	end
end
