Constants, Variables and Keywords

the alphabets, numbers and special symbols when properly combined form constants, variables and keywords. Let us see what are 'constants' and 'variables' in C.
  A constants is an entity that does not change, whereas, a variable is an entity that may change.

In any program we typically do lots of calculations. the result of these calculations are stored in computer's memory. Like human memory, the computer memory also consists of millions of cells. the calculate values are stored in the memory cells. To make the retrieval and used of this values easy these memory cells (also called memory location) are given name. Since the value stored in each location may change the names given to these locations are called variable names. Consider the example shown in bellow.

   Here 4 is stored in a memory location and a name X is given to it. then we have assigned a new value 7 to the same memory location X. This would overwrite the earlier value 4, since a memory location can hold only one value at a time.



Since the location whose name is X can hold different values at different time X is known as a variable. As against this , 4 or 7 do not change, hence are known as constant.        https://www.facebook.com/sushildas960/                     

Comments

Post a Comment

popular posts

SEMICONDUCTOR DIODE

logical OR Operation