LANGUAGE » C
Operators
Arithmetic
Operator | Description |
---|---|
+ | Addition or unary plus |
- | Subtraction or unary minus |
* | Multiplication |
/ | Division |
% | Remainder after division (modulo division) |
++ | Increment |
-- | Decrement |
Assignment
Operator | Example | Same as |
---|---|---|
= | a = b | a = b |
+= | a += b | a = a + b |
-= | a -= b | a = a - b |
*= | a *= b | a = a * b |
/= | a /= b | a = a / b |
%= | a %= b | a = a % b |
Relational
Operator | Description |
---|---|
== | Equal to |
!= | Not equal to |
> | Greater than |
< | Less than |
>= | Greater than or equal to |
<= | Less than or equal to |
Logical
Operator | Description |
---|---|
&& | AND |
|| | OR |
! | NOT |
Bitwise
Operator | Description |
---|---|
& | AND |
| | OR |
^ | XOR |
~ | Complement |
<< | Shift left |
>> | Shift right |