What are variables? What are the conditions for variables?


A variable is a data name that may be used to store data value. A variable may take different value at different times during execution. Some examples are, average, height, class_strength.

Conditions for variables: 

Variable names may consist of letters, digits and the underscore character, subject to the following conditions.
  1. Must consist of only letters, digits and underscores.
  2. First character must be an alphabet. Some system permits underscore as the first character.
  3. 31 characters are permitted. But only the first 8 characters are significant.
  4. Uppercase and lowercase are significant.
  5. It should not be a keyword.
  6. White spaces are not allowed.
  7. Keyword may be a part of the variable. such as , int_type.

Author: Tanmay Chakrabarty

Tanmay Chakrabarty is a former CSE student, currently working as a Senior Software Engineer with 5+ years of experience in the field of Web Application development in PHP+MySQL platform with strong skills in Javascript, JQuery, JQuery UI and CSS. He tries to write notes every week but fails due to heavy loads of duty.

Recommended Recommends


Contact Us