A variable is a name that the compiler assigns to one or more memory location(s). When you declare a variable in a program, you have to specify its type and name. The type of a variable specifies the kind of values that the variable can store and the set of operations that the program can execute on variables. For the int variable type, the C# compiler usually allocates 32 bits (4 bytes). The int variable type can store values from -2,147,483,648 to 2,147,483,647. The following image illustrates how an int variable type is represented in C#:
Int variable types are integer numbers. They do not have a fractional part, like real numbers (represented in floating point). If you assign to an int variable a value outside the -2,147,483,648 to 2,147,483,647 range, you will get what programming calls overflow, and the assigned value will be wrong.
The concepts explained in this lesson are also shown visually as part of the following video: