Binary and unary operators
Binary and unary operators are two very important concepts in programming because they can both respectively be used to manipulate data. So, let's start with binary operators.
Binary operators
There are several operators, some of which you may already be familiar with, and some that you may not know, even if you have some programming experience. So, take a look at see all of them!
Assigning values
There are several operators that can assign a value to an expression:
Operator |
Explanation |
---|---|
e1 = e2 |
Assigns the value of e2 to the expression e1. It returns the value of e2; |
+= -+ *= /= %= &= |= ^= <<= >>= >>>= |
Assigns the value to the expression on the left after performing the operation (see before). For example, |
Comparison operators
There are several comparison operators, all of them returning either true or false.
Operator |
Explanation |
---|---|
e1 =... |