As the name suggests, these are the symbols used for assignment purposes. Well, these are not assignments related to our school or college, but the assignment of values to some variable. If you observe carefully, the first assignment operator symbol, which is ”=”, is being used for quite a long. This is a simple assignment operator, where we are just assigning some value to some variable.
|=||This operator is used for assignment|
|+=||This is referred to as add and assign|
|-=||This is referred to as subtracting and assigning|
|*=||This is referred to as multiply and assign|
|/=||This is referred to as divide and assign|
|%=||This is referred to as modulus and assign|
|**=||This is referred to as power and assign|
As you can see, things went according to what we had set for the operators. We have been using the simple assignment operator for a long right? And now we are even used to it. Just like that, we will get used to the other operators as well, when we start using them on a quite regular basis. Now, let’s move on to have a look at other operators as well.