Friday, 18 May 2012

basic understanding of variables in c language

For understanding variables in c language we need to assume a situation that we live in world. we all are human.but every one has different name and surname. We divided ourself into category.Similarly data(name,id,any value) in computer is a group which is divide into different types. And each type is given a name. Which is called as character,integer,float etc. from above discussion we conclude that

Variables is a form to represent information in any programming language. which provide a way to store data in memory.
from above diagram we can see we have data that belongs to different category like
some data is whole number and some is decimal number and some is character or string. According to it we divides data into type.
  1. Integer 
  2. Float 
  3. Character
Example : We live in house.So house is a variable which provide a storage for us. As house can be in different style which define it's type. Similarly variable is a storage place for data in computer memory but as house is in different style variable have different type.  



  1. Integer:  It is way to represent whole number in programming language.
  2. Float:  It is way to represent decimal values in programming language.
  3. Character:  It is way to represent alphabetic and non-alphabetic data in programming language.
   

No comments:

Post a Comment