An entity that may very during the program execution is known as variable .Variable are the name given location in a memory .rules are
1. Length is must be 1-31 character
2. Only alphabet digit & underscore is used.
3. First character must be an alphabet or an underscore
4. Name can’t start with digit
5. Keywords can’t be used
6. Space & symbol are not allowed
7. Upper case and lower case are different
Example of Variable
#include<stdio.h>
#include<conio.h>
void main(){
int i;
clrscr();
printf("Enter a value of i:");
scanf("%d",&i);
printf("%d",i);
getch();
}
Output
Enter value of I = 56
56
0 Comments