Arduino Arithmetic Operators - Arduino

What is Arduino Arithmetic Operators?

Assume variable A holds 10 and variable B holds 20 then –

Operator name

Operator simple

Description

Example

assignment operator

=

Stores the value to the right of the equal sign in the variable to the left of the equal sign.

A = B

addition

+

Adds two operands

A + B will give 30

subtraction

-

Subtracts second operand from the first

A - B will give -10

multiplication

*

Multiply both operands

A * B will give 200

division

/

Divide numerator by denominator

B / A will give 2

modulo

%

Modulus Operator and remainder of after an integer division

B % A will give 0

Example

Result

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Arduino Topics