C# tutorial- Expressions and Operators
C# Expressions and Operators
The ability of a programming language to perform calculations or operations is perhaps the most important one. To do operations on values, operators are needed.
-Assignment operator (=)
Assignment operator is used to assign a value to a variable;
Arithmetic operators are used to perform arithmetic operations on variables.
-Compound assignation operator (+=, -=, *=, /=, %=, <<=, >>=, &=, |=, ^=)
Compound assignation operator is used to perform operations (+, -, *, /,…) on variables with assignment operation.
-Comparison Operators (==, >, <, >=, <=,!=)
Comparison operators are used to compare variables. They return a Boolean value (true or false).
-Increment and Decrement operators (++, --, ++, --)
These operators are used to make increment or decrement on a variable.
-Logical Operators (&&, ||, !)
Logical operators are used to evaluate two expressions and return one result.
Bitwise operators are used to modify bits that represent the values that they store.