If you want to learn programming you must know variable, constant, keywords ,data type and operators in C language.In the previous post we have learn what is constants and type of constants.In this post we will learn Variable.as we know that variable, constant and keyword are the part of the syntax.
- what is character in C and
- what is identifier in C
- Variable
C Character set
A character denotes any alphabet, digit or special symbol used to represent information.
Identifier in C
In C programming language identifier is a name given to variable, structure, union, function.The name can contain alphabets digits as shown in above table.
For example
int number;
Here in the above example number is a identifier which denote the variable of integer data type.
Variable:
A value which may change during program execution is called a variable.Variable is nothing but a name to specific location in the memory of computer where different constant are stored.These locations can contain data type as integer,float,character constants.Variable also allows Variable is a container that hold the value of data type.Syntax of variable
type variable_list;
Here in the above example type is a data type of c programming language and variable list is a list of variables which are separated by commas.
int a,b,c;
float f;
char c,ch;
double d;
The line a,b,c declare and define the variable a , b and c and which instruct the compiler to create Variable of data type int.
We can initialize the value of Variables at the time of declaration as follows
type variable_name=value;
0 comments:
Post a Comment