arithmetic_operators
🔢 Arithmetic Operators​
Ruby supports the basic arithmetic operators: +
(addition), -
(subtraction), *
(multiplication), /
(division), and %
(modulus). Use them directly with numbers or numeric variables to perform calculations.
a = 8 + 2 # 10
b = 10 - 3 # 7
c = 4 * 5 # 20
d = 20 / 4 # 5
e = 10 % 3 # 1 (remainder)