LISP program to find the area of a circle using a function
kw.lisp
(write-line"———————————————————————————————————————————")(write-line"Program to find the area of a circle")(write-line"———————————————————————————————————————————")(princ"Enter the radius ")(setqr(read))(defconstantPI3.1416)(defunArea()(setqA(*PIrr))(terpri)(princ"The area of a circle is ")(writeA)(setqC(*6.2831r))(terpri)(princ"The circumference of a circle is ")(writeC))(Area)(terpri)(formatt"———————————————————————————————————————————")
Output
kodingwindow@kw:~$ clisp kw.lisp
———————————————————————————————————————————
Program to find the area of a circle
———————————————————————————————————————————
Enter the radius 10
The area of a circle is 314.15997
The circumference of a circle is 62.831
———————————————————————————————————————————
kodingwindow@kw:~$
Advertisement
Thank You
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?