Variable in “C” language

To process any type of data, we have to first decide what kind of data we want to store in the memory of the computer because as long as we store the data to be processed in the computer's memory If we do not, we cannot process that data.

Since different types of data reserve space of different sizes in memory, when we get to know the type of data to be processed, then in-memory based on the keyword representing that data type Some reserve space and assign a name to that space. This name is a Symbolic Identifier of the Reserved Memory Location, which is determined based on the rules of the Identifier Naming Convention.

To store data based on the need of the program, the process of reserving the space in the memory of the computer and giving a symbolic name of that space is called Identifier Declaration.

If the value of the identifier to be defined remains constant throughout the program, this process is called Constant Declaration, while if the value of the identifier to be defined changes from time to time throughout the program depending on the need of the program, it Variable Declaration says.

Variables hold a very important place in computer programming. variables, named locations that are used to store a value. Each variable has a name and value as well as a Type.

A variable is an identifier or storage area that is used to store data, containing variable data that can be changed at any time during program execution.

After declaring the variable, it is given a value, assigning this value as follows. Like - x = 5; Or a = 10;

Before using a variable it is necessary to declare it, without declaring the variable, you cannot use it.

For example, suppose we have to store the name and roll number of a student in a variable. For this, we take two variables, one store the student's name in the variable while the other stores the roll number in the variable.

Variable Naming Convention in “C” language

  • Any Upper Case and Lower Case Character can be used in the name of any variable.
  • Underscore can also be used in the name of any identifier.
  • If we want to use digits in the name of any variable, it is necessary to have at least one Character or Underscore before using the digits.
  • Apart from this, any type of Special Symbol such as Period, Comma, Blank Space, etc. cannot be used in the name of the variable. Also, we cannot use the name of a Reserved Word or a Built-In Function in the name of the variable.
  • The name of any variable cannot begin with a digit.
  • "C" is a Case Sensitive Language, so the names of Capital Letters and Small Letters are considered different in this language. Like - int sum and int sum will be two different Variable Name or Identify and not same.


I am an engineer by profession but being a blogger is my old day's dream to create my site for those who are more curious about my birthplace than I am coming from (India). the current city lives in Navi Mumbai, India

Post a Comment


Previous Post Next Post

نموذج الاتصال