; calculate a factorial reecursively (define (fact1 x) (if (= x 0) 1 (* x (fact1 (- x 1))))) ; tail reursive version (define (fact2 x) (define (factloop x accum) (if (< x 1) accum (factloop (- x 1) (* accum x)))) (factloop x 1)) (let ((x (read))) (displayln (fact1 x)) (displayln (fact2 x)))