What is Variable.?

Variables is a name or identifiers. In programing language a variable is nothing but name or identifiers which can be used to store the values. A variable is like a container which can hold the different type contents. Internally a variable is represented as a memory location name.

Example of variable declaration:

	
    datatype: variable_name: assignement_operator: value
    
                                                  
     int           a              =                 10 
    

In above example 'a' is variable whose data type is int. Also see the below example for more clarification.

Example of Variable.

A variable like is container which can hold different type of contents.

int a=10;
char gender='m';

Example of Variable with memory location:

See the above example how variable store in the memory. When we create a variable, the memory to a variable allocated at that time.

Advertisement here

Share this Page.

Post Your Comment