Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
17
Task/Arithmetic-Integer/XLISP/arithmetic-integer.xlisp
Normal file
17
Task/Arithmetic-Integer/XLISP/arithmetic-integer.xlisp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
(DEFUN INTEGER-ARITHMETIC ()
|
||||
(DISPLAY "Enter two integers separated by a space.")
|
||||
(NEWLINE)
|
||||
(DISPLAY "> ")
|
||||
(DEFINE A (READ))
|
||||
(DEFINE B (READ))
|
||||
(DISPLAY `(SUM ,(+ A B)))
|
||||
(NEWLINE)
|
||||
(DISPLAY `(DIFFERENCE ,(- A B)))
|
||||
(NEWLINE)
|
||||
(DISPLAY `(PRODUCT ,(* A B)))
|
||||
(NEWLINE)
|
||||
(DISPLAY `(QUOTIENT ,(QUOTIENT A B))) ; truncates towards zero
|
||||
(NEWLINE)
|
||||
(DISPLAY `(REMAINDER ,(REM A B))) ; takes sign of first operand
|
||||
(NEWLINE)
|
||||
(DISPLAY `(EXPONENTIATION ,(EXPT A B))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue