Operators in C#.Net
C# provides below types of operators.
- unary – +, -, *, &
- Arithmetic – +, -, ++,–, /, %, =, +=, -=, *=, /=, %=, ==, !=, <=, >=, is, as
Conditional – && ||
Logical – &, |, <<, >>, &=, |=, ^=, <<=, >>=
Conditional operatort ? x : y – if test t is true, then evaluate and return x; otherwise, evaluate and return y.
Null Coalescing operatorx??y returns x if it is not null else returns y
Lambda operator =>
- Have you ever wondered real world applications of bit wise operators? They are primarily used in hardware and embedded programming.
- Can you guess the output of below code?
double b = a/0;