Identifier Variables Constant
Identifier Variables Constant
CONSTANT
TOPIC 3
USING & NAMING VARIABLES
Variables are named memory locations whose
contents can vary or differ over time
At any moment in time a variable holds just one
value
The ability of memory variables to change in value
that makes computers and programming worthwhile
Because one memory location can be used over and
over again with different values, you can write
program instructions once and used them for
thousands of separate calculations
Cont..
A variable name is also called identifier
Every computer programming language has its own
set of rules for creating identifiers
Most languages allow both letters and digits within
variable names
Some languages allow hyphens in variable names—
for example, hourly-wage
Others allow underscores, as in hourly_wage
Still others allow neither
Some languages allow dollar signs or other special
characters in variable names (hourly$); others
allow foreign alphabet characters, such as π or Ω
Cont..
Different languages put different limits on the length of variable
names