Professional Documents
Culture Documents
Areeb Lab #9
Areeb Lab #9
Areeb Lab #9
Declaration of Variable
Declaration of variable in c can be done using following syntax:
data_type variable_name;
or
data_type variable1, variable2,…,variablen;
Initialization of Variable
C variables declared can be initialized with the help of assignment
operator ‘=’.
Syntax
data_type variable_name=constant/literal/expression;
or
variable_name=constant/literal/expression;
Example:
int a=10;
int a=b+c;
a=10;
a=b+c;
Floating-point Types
float
double
Character Types
char
Datatypes of C language