Showing posts with label definition of variables in c. Show all posts
Showing posts with label definition of variables in c. Show all posts

Thursday 8 March 2018

Variables in C programming with demo

Variables:-

Variables:-  It is to store data in memory,which determines the size and layout of the                       variable's memory. The value of variables  may change during execution.


Rules of Variables:-

A variable name can consist of Capital letters A-Z, lowercase letters a-z, digits 0-9, and the underscore character.
The first character must be a letter or underscore.
Blank spaces cannot be used in variable names.
Special characters  are not allowed.
C keywords cannot be used as variable names.
Variable names are case sensitive.
Values of the variables can be numeric or alphabetic.

Variable type can be char, int, float, double or void.


1.Int :- It is used to store integer values

 eg:- int a=5;
         int b=6;

2.Float:- It is used to store real number 0r decimal number

  eg:- float a=10.3;
          float b=11.3;

3.char:-It is used to store char value,The size of character variable is 1 byte.This is an integer type.
  eg:-  char test='v';

4. Void:-Repsents the absent type value.
For more info click here