Professional Documents
Culture Documents
Definition: Variables are named memory locations whose contents can vary or differ
over time.
eg
int x;
x=10;
x=x+10;
• Every computer programming language has its own set of rules for creating
identifiers
• Reserved keywords
• Different languages put different limits on the length of variable names
• Case sensitive identifiers
• Commonly used variable naming conventions
Convention for naming Examples Languages where
variables commonly used
#include <stdio.h>
int main()
{ int a,b,c;
char x,y,z;
a=5;b=4;
x='5';y='4';
c=a+b;
z=x+y;
printf("\na=%d\tb=%d\taddition of int %d and %d is %d",a,b,c,a,b);
printf("\nx=%c\ty=%c\taddition of char %c and %c is %d",x,y,z,x,y);
return 0;
}
Named Constants