### Operator Mod= (Modulus and Assign)

Divides a value and assigns the remainder to a variable

**Syntax:**

**Usage:**

`
`

*lhs*

**Mod=**

*rhs*

**Parameters:**

*lhs*
The variable to assign to.

*rhs*
The value to divide

`by.`*lhs***Description:**

This operator divides two values of

This operator can be overloaded for user-defined types as a member

`Integer`type and assigns the remainder to its left-hand side (`) variable. It is functionally equivalent to:`*lhs*This operator can be overloaded for user-defined types as a member

`Operator`using the appropriate syntax.**Examples:**

Dim n As Integer

n = 11

n Mod= 3

'' The result is 2

Print n

Sleep

n = 11

n Mod= 3

'' The result is 2

Print n

Sleep

**Dialect Differences:**

- In the
*-lang qb*dialect, this operator cannot be overloaded.

**Differences from QB:**

- New to FreeBASIC

**See also:**

Back to Assignment Operators

Back to Operators