Before discussing variables, let us take a look at Memory and its structure:
Memory consists of millions of memory Cells and each memory cell stores data in the form of 0s and 1s (binary digits). Each cell has a unique address, and by using this address, the cell can be accessed:
When data is stored in memory, its content gets split into further smaller forms (binary digits). As shown in the preceding diagram, 2 bytes of data consists of several memory cells.
A variable is the name that is given to a particular chunk of memory cells or simply a block of memory and is used to hold data.
You can declare any desired name and create a variable to store the data.
It is recommended, however, that we use meaningful variable names. For example, if we wish to create a variable to store the name of a person, then we should declare
Name: Andy
It is a good practice...
Name: Andy
It is a good practice...