RosettaCodeData/Task/Temperature-conversion/XLISP/temperature-conversion.l
2023-07-01 13:44:08 -04:00

13 lines
343 B
Common Lisp

(DEFUN CONVERT-TEMPERATURE ()
(SETQ *FLONUM-FORMAT* "%.2f")
(DISPLAY "Enter a temperature in Kelvin.")
(NEWLINE)
(DISPLAY "> ")
(DEFINE K (READ))
(DISPLAY `(K = ,K))
(NEWLINE)
(DISPLAY `(C = ,(- K 273.15)))
(NEWLINE)
(DISPLAY `(F = ,(- (* K 1.8) 459.67)))
(NEWLINE)
(DISPLAY `(R = ,(* K 1.8))))