Assignment Operator

C#In any language, there is major use of assignment operator.  Assignment operator is used to assign a value to any variable.  If you want to initialize the value of any variable at the starting point or later, you can make use of assignment operator.  The assignment operator is represented by equal sign (=).  A very simple example is given below.

using System;

public class Program
{
public static void Main()
{

int number = 2;

Console.WriteLine(number);
}
}

In the above given example, we have assigned a value 2 to the variable number and we are making use of WriteLine function to print the value of number variable.