Variable Declaration | create a variable | How variable declare

Variable Declaration:

The process in which we create a variable for store the data is called variable declaration.
Or
To assign a name of variable to store the data is called variable declaration.

This process consists on these steps:-

       1. Give the data type
       2. Give name to the variable
       3. Assign the value (in case of solid coded variable)

Give the type:
                              We assign a data type according to our need. There is many data type which we used as per our requirement. To assign data type is very important and sensitive issue, because if we assign a wrong or invalid data type then the value store in the value may disturb or distort.int, float and char are the examples of the data type.
Give name:
                              After this we give variable a name by which it is to be called in the program. This name could be a underscore (_) or any alphabet. The C and C++ are the case sensitive languages, which means that in these language int a and int A consider as two different variables. By naming variable we just call the name of variable and the value of variable is used in the program.

Assign a value (in case of solid coded value):
                              If we want to assign a constant value to the variable, we assign that value with the use of assignment operator (=). By this we declare the value of value in the time of creating the variable.

Example:-

In soft coded variable:
Int n;
Float w;
Char c;

In solid coded variable:
Int n =2;
Float w=3.1416;
Char c=’A’;



Comments

Popular posts from this blog

Umbrella activities in Software Engineering

Operating System | Best Definition of Opetating System