If you´ve decided to take on private lessons in programming, you may have already learned that every programming language used involves the concept of a variable.
A variable is the name given to a computer memory location where some data is stored for processing. There are some programming languages in which we need to define a variable before we use it and there are some programming languages in which we don't need to define a variable. No matter what is the case, whenever there is a variable then there are some aspects associated with it.
When we use a variable, then we deal with following aspects of variable:
So every variable has a name. In programming langauges like C, C++ and Java we need to define them. When we define them then we need to mention their data type such as char, int, float.
The data type of variables basically define the type of values that the variable can contain. For example we can define variables like below:
Once a variable is defined then we can put some value in it like below:
There are some programming languages where we don't need to define a variable like Python, PHP, JavaScript. In these languages when we need to store some value then we have to define a variable like below:
Once some value is stored in a variable then we can display its value using some output statement. We can perform mathematical operations using mathmatical operators. We can write conditions using relational operators. So variables are the most valuable part of a program.
If you´re interested in learning programming and you´d like private lessons, I am a freelance software developer and private programming tutor. Feel free to get in contact about an initial lesson!