Traditional arithmetic operations are supported on numeric types in LOLCODE:
BTW Addition SUM OF x AN y BTW Subtraction DIFF OF x AN y BTW Multiplication PRODUKT OF x AN y BTW Division QUOSHUNT OF x AN y
Let’s start with the two most basic:
SUM OF: Creates the sum of
x + yin most languages)
DIFF OF: Subtracts
x - yin most languages)
If either number in an operation is a
NUMBAR, the result will be too. Otherwise the result will be a
BTW equates to 7 SUM OF 3 AN 4
Multiple operations can be within the same statement, and will follow the traditional order as with other programming languages.
BTW equates to 5 DIFF OF SUM OF 3 AN 4 AN 2
Print out the sum of
Print the result of adding 7 to the difference of 70 and 13.