Created
March 30, 2018 16:48
-
-
Save ridvanbaluyos/b93b92fc8a05dbc22c5b00242c7a12fa to your computer and use it in GitHub Desktop.
Convert Fahrenheit to Celsius using Common Lisp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun f-to-c () | |
(format t "~%Please enter Fahrenheit temperature: ") | |
(let* | |
( | |
(ftemp (read)) | |
(ctemp (* (- ftemp 32) 5/9)) | |
) | |
(format t | |
"~%~s degrees Fahrenheit is ~s degrees Celsius~%" | |
ftemp | |
(float ctemp) | |
) ;; print floated value | |
ctemp ;; return ration value | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output