(write-line"———————————————————————————————————————————")(write-line"Program to perform the bitwise operations")(write-line"———————————————————————————————————————————")(princ"Enter the 1st number ")(setqa(read))(princ"Enter the 2nd number ")(setqb(read))(formatt"~%~d AND ~d | ~d"ab(logandab))(formatt"~%~d NAND ~d | ~d"ab(lognandab))(formatt"~%~d INCLUSIVE OR ~d | ~d"ab(logiorab))(formatt"~%~d EXCLUSIVE OR ~d | ~d"ab(logxorab))(formatt"~%~d NOT ~d | ~d"ab(lognorab))(formatt"~%~d EQUIVALANCE ~d | ~d"ab(logeqvab))(terpri)(formatt"———————————————————————————————————————————")
Output
kodingwindow@kw:~$ clisp kw.lisp
———————————————————————————————————————————
Program to perform the bitwise operations
———————————————————————————————————————————
Enter the 1st number 1
Enter the 2nd number 0
1 AND 0 | 0
1 NAND 0 | -1
1 INCLUSIVE OR 0 | 1
1 EXCLUSIVE OR 0 | 1
1 NOT 0 | -2
1 EQUIVALANCE 0 | -2
———————————————————————————————————————————
kodingwindow@kw:~$
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.