Type Declaration Instruction

    11001157 VIEW 4 0

Type Declaration instruction is used to declare the type of variables to be used in a C program. Any variable must be declared before using  it. This declaration is done using type declaration instruction.

Syntax: Type declaration instruction

data-type variable_name;

Here,
data-type represents any valid C data-type. E.g. int, char, float, double etc.
variable_name can be any valid name satisfying rules for constructing variables in C.

 

This declaration is done at the beginning of the main() function as shown below.

Example:


int main(){
     int balance, rate;
     float amount;
}