Hello friends,
I want some information about C# Operators. I just start learning C#.
Thanks
Hello friends,
I want some information about C# Operators. I just start learning C#.
Thanks
C# provides a large set of operators, which are symbols that specify which operations to perform in an expression. C# predefines the usual arithmetic and logical operators, as well as a variety of others as shown in the following table.
Arithmetic + - * / %
The arithmetic operators (+, -, *, /) can produce results that are outside the range of possible values for the numeric type involved.
Integer arithmetic overflow either throws an OverflowException or discards the most significant bits of the result (see below). Integer division by zero always throws a DivideByZeroException.
Logical (boolean and bitwise) & | ^ ! ~ && || true false
String concatenation +
Increment, decrement ++ --
Shift << >>
Relational == != < > <= >=
Assignment = += -= *= /= %= &= |= ^= <<= >>=
Indexing []
Cast ()
Conditional ?:
Most operators are either unary or binary. Unary operators form expressions on a single variable, but binary operators form expressions with two variables.
Bookmarks