Mask-group

Constants, Variables, Keywords



  • The alphabets,digits,symbols when properly combined forms constants,variables and keywords.

  • Constants do not change whereas variables can be changed.

  • Variables are used to store data.It’s value can be changed and can be reused many times.

Rule to name Variables and Constants:

  • The first character of a variable or constant name must be an alphabet or underscore.

  • Variable or constant names can have alphabets,digits or underscores.

  • No commas or blanks are allowed within a name of variable or constant.

  • No special symbol other than underscore can be used.

  • Variable or constant name must not be any reserved word i.e keyword.

Keywords:

  • Keywords are the reserved words i.e the words whose meaning has already been explained to the computer.

  • These keywords cannot be used as variable or constant names because if we do so we are trying to assign a new meaning to the keyword,which is not allowed.

Declaration of Variables in C:

  • C compiler makes it compulsory to declare the types of any variable name that you wish to use in your code.This type declaration is done at the beginning of the program.

  • For example:

int marks;
float percentage;
char name;