The C++ programming language offers different types of operators. These operators are used in expressions that evaluate to a single value. Sometimes the operator is used in decision making that changes the flow of the program.

Advertisements

Advertisements

Here is the diagram that classifies C++ operators into different categories.

Arithmetic Operators

Operator

Description

+

Addition operation

–

Subtraction operation

*

Multiplication

/

Division operation

%

Mod operation ( gives remainder)

Assignment Operators

Operator

Description

=

Assigns right-value to left-value

+=

Assigns ( left-value + right-value) to left-value

-=

Assigns ( left-value – right-value) to left-value

*=

Assigns ( left-value * right-value) to left-value

/=

Assigns ( left-value/ right-value ) to left-value

%=

Assigns (left-value % right-value) to left-value

>>=

Right-shift and then assign to left-value

<<=

Left-shift and then assign to left-value

&=

Bitwise AND operation and then assign to left-value

|=

Bitwise OR operation and then assign to left-value.

~=

Bitwise complement and then assign to left-value

Note: In the following expression is left-value and is right-value.