Account
Categories

Modulus Operator


Definition:

The Modulus Operator (%) is used to find the remainder when one value is divided by another. These values are called operands.

It helps in performing mathematical calculations in programs or webpages.

Syntax:

result = left_operand % right_operand

Example:

a = 10
b = 3
mod = a % b
print("The modulus is:", mod)

Output: