The
variable in C# is nothing but a name given to a data value. Each variable in C#
has a specific type, which determines the size and layout of the variable's
memory the range of values that can be stored within that memory.
Example :
using System;
namespace VariableExampleNameSpace
{
public class StudentClass
{
private int RollNo; ///private variable declaration
public int EnrolNo; ///public variable declaration
public void Percentage()
{
///local variable declaration,
int totalMarks = 360;
}
}
}
|