Visual C# Guide

Assignment statements assign values the value from the right hand side of the assignment operator (=) and store it in the element on the left hand side.

The left hand side of the statement must be a programming element that can store values. The most common type of assignment statement is when we assign a value to a variable.

In the following example, the literal value 5 is being stored in the variable myNumber. This statement cannot be written the other way around.

myNumber = 5;

The right hand side of the statement could be a variable, expression or combination of these things. For example,

count = count + 1;