Variable of C Language

  • A variable is one which stores some value and its value can be changed at any point of time.
  • A name given to memory Location.
  • A variable is also an identifier so rule for name identifier also applies here.
  •  A variable are a container and we are store to data by Alphabet form data or Number form data.
  • Declaring a Variable: int a; , int a,b,c; ,  int a=10,b=20;

Type of Variable

  1. Integer Variable (int)
  2. Floating Variable (float)
  3. Double Variable (dou)
  4. Character Variable (char)

Declaration

How to use by a variable. A Variable are declare by two type Syntax in this form

  1.  data_type variable_name;
  2. data_type variable_name = value ;
data_type variable_name;

#include<stdio.h>

#include<conio.h>

 

int main(){

int a;

printf(“Entre The Number “);

scanf(“%d”, &a);

printf(“\n a = %d”,a);

getch();

}

data_type variable_name = value ;

#include<stdio.h>

#include<conio.h>

int main(){

int a = 12;

printf(“\n a = %d”,a);

getch();

}

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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