What is Variable in Arduino
In short What is Variable in Arduino
- A variable is a named unit of data that may be assigned a value.
- variable is a named location in a memory where a program can manipulate the data. This location is used to hold the value of the variable.
- The value of the C variable may get change in the program.
- variable might be belonging to any of the data type like int, float, char etc.
RULES FOR NAMING VARIABLE
- Variable name must begin with letter.
- Variables are case sensitive
- They can be constructed with digits, letters.
- No special symbols are allowed other than underscore.
- sum, height ,name ,age are some examples for variable name
Example :
int led=5;
(int data type led is defined as 5 ) in entire program led is know for its value 5.
int age= 26;
(int data type age is defined as 26 ) in entire program age is know for its value 26.
age=age+2;
now age has 28 in its value. but age is name of variable in memory until program execution.
See Video Lecture
Leave a Reply
You must be logged in to post a comment.