Assignment Operators in C#.Net



In this asp.net c# post we will learn assignment operators with example.

Assignment Operators in C#.Net


C# Supports following Assignment operators

ID OPERATOR DETAIL EXAMPLE
1 = value assign from right to left operand  (X = Y)
2 += Add and assign  (X += Y)  means X = X + Y
3 -= Subtract and assign  (X -= Y) means X = X – Y
4 *= Multiply and assign  (X *= Y) means X = X * Y
5 /= Divide and assign  (X /= Y) means X = X / Y
6 %= Modulus and assign  (X %= Y) means X = X % Y

Let’s c# example to more understand about assignment operators.

The output of c# program is :

Assignment operators example in c#
Assignment operators example in c#

Leave a Reply

Your email address will not be published. Required fields are marked *