C++ VARIABLE
A Variable is the name of memory location. It is used to store data. Its
value can be changed and it can be reused many times .
It is the way to represent memory location through symbol so that it can be easily identified.
C++ VARIABLE
Type variable_list ;
The example of declaring variable is given below :
Int x ;
Float y ;
Char z ;
Here x,y,z are the variables and int , float and char are data types .
5
MEMORY
Example :-
Int a=5;
a
RULES FOR DEFINIING VARIABLES
• A variable can have alphabets , digits and underscore.
• A variable name can start with the alphabet and underscore only. It
can not start with digit.
• No whitespace is allowed within variable name.
• A variable name must not be any reserved word or keyword example
char , float etc.
RULES FOR DEFINING VARIABLES
Example
Int _a=12;
Invalid variable
Int 12

what is variables

  • 1.
    C++ VARIABLE A Variableis the name of memory location. It is used to store data. Its value can be changed and it can be reused many times . It is the way to represent memory location through symbol so that it can be easily identified. C++ VARIABLE Type variable_list ; The example of declaring variable is given below : Int x ; Float y ; Char z ; Here x,y,z are the variables and int , float and char are data types . 5 MEMORY Example :- Int a=5; a
  • 2.
    RULES FOR DEFINIINGVARIABLES • A variable can have alphabets , digits and underscore. • A variable name can start with the alphabet and underscore only. It can not start with digit. • No whitespace is allowed within variable name. • A variable name must not be any reserved word or keyword example char , float etc. RULES FOR DEFINING VARIABLES Example Int _a=12; Invalid variable Int 12