The variable is a temporary storage area in computer memory that is named as an identifier. Only be temporary because the variables are allocated into the computer's memory when the program starts only.
Variables that will be used in the program must be declared first. Declaration here means the ordering of memory and determine what kind of data can be stored in it.
The variable name (identifier) are free, but must consider the following matters:
-There should be no spaces
-Can not contain arithmetic operators
-It should not be prefixed by a number
-It should not be a reserved word in a programming language.
-Reflecting the data to be stored.
Format variable declaration:
tipe_variabel nama_variabel;
Type of variable -Global Variables
Variables that are recognized by all environments in the program.
-Local Variables
Variables are only identified by a function only, that is, not recognized by the outside environment in the program.
Variables that will be used in the program must be declared first. Declaration here means the ordering of memory and determine what kind of data can be stored in it.
The variable name (identifier) are free, but must consider the following matters:
-There should be no spaces
-Can not contain arithmetic operators
-It should not be prefixed by a number
-It should not be a reserved word in a programming language.
-Reflecting the data to be stored.
Format variable declaration:
tipe_variabel nama_variabel;
Type of variable -Global Variables
Variables that are recognized by all environments in the program.
-Local Variables
Variables are only identified by a function only, that is, not recognized by the outside environment in the program.
No comments:
Post a Comment