2. VARIABLE
• Portion of Memory to Store a Value.
• Each variable needs a unique name that distinguishes it from
others.
• Name of the variable should be a valid C++ Identifier.
a=5;
b=2;
In this, variable names are ‘a’ and ‘b’
4. IDENTIFIERS
• A valid identifier is a sequence of one or more letters, digits or
underscore “ _ “
• A valid identifier shall always begin with a letter or underscore “ _ “
• A valid identifier CAN’T contain Spaces, punctuation marks or any
other symbols.
• A valid identifier CAN’T start with a digit in any case.
• A valid identifier CAN’T be a Reserved Keyword of C++
9. DECLARATION OF VARIABLES
• Identifier for variable, followed by its data type.
int a;
float mynumber;
• To declare more than one variables of same type, separate their
identifiers with commas, in single statement.
int a,b,c; int a;
int b;
int c;
(It is exactly same as declaring variables like this)
10. INITIALIZATION OF VARIABLES
• Assigning a value to the variable from the moment it is declared.
int a=5; (value of a is 5)
float mynumber=2.5; (value of mynumber is 2.5)
int b; (value of b is undertermined)