Variables in C Programming Language

What is Variable in C?

  • Variable is the name of the memory location where the data is stored.
  • Unlike the constant, the value of variables can be changed while the execution of the program.
  • The programmer should choose a meaningful variable name like total, age, height, 
  • The variable might be belonging to any of the data types like int, float, char etc.


Rules of naming variable in C:


  • Variable name should start with the alphabet or underscore.
  • Variable name must not start with the digit.
  • Variable are case sensitive 
  • Blank spaces are not allowed while naming the variable.
  • Keywords are not allowed to use as a variable name.


Declaration of variables:


Declaration helps the compiler to know the what is the name of variable and type of data it holds 


Previous Post Next Post