Relational Operators Operator Description Example == Equal to if (x

Operator
==
!=
<
>
>=
<=
Operator
+
*
/
%
++
--
Operator
=
+=
-=
Operator
&&
||
Relational Operators
Description
Equal to
Not equal to
Less than
Greater than
Greater than or equal to
Less than or equal to
Arithmetic Operators
Description
Addition
Subtraction
Multiplication
Division
Modulus
Increment
Decrement
Assignment Operators
Description
Assignment
Assign and sum
Assign and subtract
Logical Operators
Description
Logical AND
Logical OR
Example
if (x == 5)
if (x != 5)
if ( x < 5 )
if ( x > 5 )
if ( x >= 5 )
if ( x <= 5 )
Example
a=b+c
a=b-c
a=b*c
a=b/c
a=b%c
a++
a--
Example
x=5
x += 5
x -= 5
Example
if (( x > 5) && ( x < 10 ))
if (( x == 5) || ( x == 6 ))
Operator
&
|
^
<<
>>
~
Bitwise Operators
Description
AND
OR
Exclusive OR
Shift left
Shift right
Complement
Example
a = b & 0x0F
a = b | 0x80
a = b ^ 0x0F
a = b << 4
a = b >> 4
a = ~b