Arithmetic Operators
Symbols | Meaning |
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Modulus(Remainder) |
Relational Operators
Symbols | Meaning |
> | greater than |
>= | greater than or equal to |
< | less than |
<= | less than or equal to |
== | equal to |
!= | not equal to |
Logical Operators
Symbols | Meaning |
&& | And |
|| | Or |
! | Not |
Logical AND (&&) Truth Table
X | Y | Z = X * Y |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Logical OR (||) Truth Table
X | Y | Z = X + Y |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Logical NOT (!) Truth Table
X | X |
0 | 1 |
1 | 0 |
Other Assignment Operators
Symbols | Meaning |
+= | plus equal |
-= | minus equal |
*= | multiply equal |
/= | divide equal |
%= | modulus equal |
-- | minus minus (decrement) |
++ | plus plus (increment) |