C# - Part 6 - Basic Operators - Tutorial For Beginners
In this video we are learning about some of the most common C# operators Timestamps -- 00:00 Intro 00:26 Assignment Operator 01:19 Arithmetic Operator 04:00 Comparison Operator 07:10 Conditional / Logical Operator 10:02 Ternary Operator Here is a complete list of every C# operator available: Arithmetic + : Adds two numbers. - : Subtracts one number from another or negates a number. * : Multiplies two numbers. / : Divides one number by another. % : Returns the remainder after division. Comparison == : Checks if two values are equal. != : Checks if two values are not equal. < : Checks if one value is less than another. > : Checks if one value is greater than another. <= : Checks if one value is less than or equal to another. >= : Checks if one value is greater than or equal to another. Logical && : Returns true if both conditions are true (logical AND). || : Returns true if at least one condition is true (logical OR). ! : Returns the opposite logical value (logical NOT). Bitwise & : Performs bit-by-bit AND operation. | : Performs bit-by-bit OR operation. ^ : Performs bit-by-bit XOR operation. ~ : Flips all the bits of a number. << : Shifts bits to the left. >> : Shifts bits to the right. Assignment = : Assigns a value to a variable. += : Adds a value to a variable and assigns the result. -= : Subtracts a value from a variable and assigns the result. *= : Multiplies a value with a variable and assigns the result. **/**= : Divides a value by a variable and assigns the result. %= : Finds the remainder of a division and assigns it to a variable. <<= : Shifts bits to the left and assigns the result to a variable. >>= : Shifts bits to the right and assigns the result to a variable. &= : Performs bitwise AND and assigns the result to a variable. |= : Performs bitwise OR and assigns the result to a variable. ^= : Performs bitwise XOR and assigns the result to a variable. Others ?: : Evaluates a condition and returns one of two values (ternary conditional). is : Checks if an object is compatible with a given type. as : Attempts to convert an object to a given type. sizeof : Returns the size (in bytes) of a data type. typeof : Returns the type of an object. new : Creates a new instance of an object. ?? : Returns a value if not null, otherwise returns a default value. ??= : Assigns a value to a variable only if it's currently null.
Download
0 formatsNo download links available.