Programming / Basics / Variables
Variables
-
Note
1. Variable Declaration & Usage
Variable Declaration is a statement that provides the variable name and its type, allowing the program to allocate memory for storing values.
1. = sign is used to store the data to the variable. This statement gives the instruction to the CPU to store the data in the memory.
2. left part of the = is variable name
3. right part of the = is data
4. Left part of the = , ie variable name is used to read the data from the memory. This statement gives the instruction to the CPU to read the data from memory and return to the program
-
Type of variables
Variable Type Data Type Multiple data allowed? Integer Integer data only No String Any data No Boolean 1 or 0 , true 0r false No Date date No Array Any data Yes Object Any data Yes