C++ Operators & Operator Precedence

The table below lists the precedence and associativity of C++ operators. Operators are listed top to bottom, in descending precedence.

When parsing an expression, an operator which is listed on some row will be bound tighter (as if by parentheses) to its arguments than any operator that is listed on a row further below it.

Operators that are in the same cell (there may be several rows of operators listed in a cell) are evaluated with the same precedence, in the given direction.

An operator's precedence is unaffected by overloading.

Arithmetic
var x = 3 Initialization It assigns the value specified on ots left to the variable on the right at the point of declaration. = Assignment Is a binary operator that assigns the value on the right to the variable its the left. + Addition It is a binary operator that returns the sum after adding the left operand the right. - Subtraction It is a binary operator that returns the value after subtracting the value of the right operand from the left. / Floating point division * Multiplication It is a binary operator that returns the product after multiplying two operands. % Modulus operator It is a binary operator that returns the remainder after dividing the the left operand with the right.

Relational
== Equal to It tests and returns true if the value of the left operand is the same as that of the right operand, otherwise it returna false. > Greater than It is a binary operator that tests if value of the left operand is greater than the value of the right operand and returns true other wise it returns false. < Less than Tests if value1 is less than value2 and returns true other wise it returns false. != Tests if value1 is not equal to value2 and returns true other wise it returns false.

Logical
&& - AND - It returns true if and only if both values in the condition evaluates to true otherwise it returns false. - It returns true if one or both of the values are true other otherwise it returns false ! Not It is a unary operator that negates the falsity of a condition.
 * - OR