# Arithmetic Operators in LISP

• Last Updated : 21 Sep, 2021

Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, and division.

There are 7 arithmetic operators in LISP that are listed in the below table:

Example 1: LISP Program that demonstrates arithmetic operators

## Lisp

 `;set value ``1` `to ``300``; set value ``2` `to ``600``(setq val1 ``300``)``(setq val2 ``600``)`` ` `;addition operation``(print (``+` `val1 val2))`` ` `;subtraction operation``(print (``-` `val1 val2))`` ` `;multiplication operation``(print (``*` `val1 val2))`` ` `;division operation``(print (``/` `val1 val2))`` ` `;modulus operation``(print (MOD val1 val2))`` ` `;increment a by ``10``(print (incf val1 val2))`` ` `;decrement b by ``20``(print (decf val1 val2))`

Output:

```900
-300
180000
1/2
300
900
300 ```

Example 2:

## Lisp

 `;set value ``1` `to ``30``; set value ``2` `to ``15``(setq val1 ``30``)``(setq val2 ``15``)`` ` `;addition operation``(print (``+` `val1 val2))`` ` `;subtraction operation``(print (``-` `val1 val2))`` ` `;multiplication operation``(print (``*` `val1 val2))`` ` `;division operation``(print (``/` `val1 val2))`` ` `;modulus operation``(print (MOD val1 val2))`` ` `;increment a by ``10``(print (incf val1 val2))`` ` `;decrement b by ``20``(print (decf val1 val2))`

Output:

```45
15
450
2
0
45
30 ```

My Personal Notes arrow_drop_up