Operators

An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations.


For example:

Operators Explanation
= assign a value. for example: a=5 will assign the value 5 into the field a
+ Add
- Subtract
* Multiply
/ Devide
+= To add a numeric value to the variable.
For example to add 6 to i we can write:
i = i+6;
Or
i+=6;
-= The same goes for minus if we want to reduce 2 from i we can write:
i-=2;
*= We will use the *= to multiple the number
i*=3
/= and this operator to divide the number
i/=3;
++ The ++ operator is used to increase the value by 1
int i=5;
i++;
at this point i will be 6.
-- The - operator reduces the value by 1
int i=5;
i--;
at this point i will be 4.

More information about operators can be found at: MSDN C# Operators


Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com