Variable in C Programming

Variable definition – Variable in C programming language is that entity which stores any constant under any name in the memory. Value of variable varies with the execution of the program. At one point of time a variable has different value and at another point of time it has some other value. A variable is a run time entity which stores constant in itself. It is a user defined word whose name is decided by the user. For ex – rno, r1, c1, cd43 etc. You will know how to declare them in the further chapters.Rules to define variable names-

  • A variable name should start with an alphabet but there after it may be a combination of alphabets and numbers. It can also start with an underscore and can be used anywhere in the variable name. For ex – p_c, _c, c_language, c_n_r etc.
  • A variable name should not contain any blanks or any special characters like $, +, %, &, =, -, ¬†etc.
  • A variable name should not be any reserve word or the key word of the language. Reserve word is that word which has unique and specific meaning in the language. It means these words cannot be used as a variable name or user defined words. For ex – for, while, do, if, switch, return, brake etc. are few reserved words of the language.

yashan has written 69 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>