Data type in C
Data type is the instruction that is used to declare the category or types of variable being used in the program. Any variable used in the program must be declare before using it. Types of data type can be either predefined or derived.
Predefined data type: int, float and char
Derived data type: array, string, structure etc.
Int : Int represents integer number ( number without fraction). It requires 2 Bytes memory space. Derived data types of int are short int, long int.
Float: Float represents real number ( number with fraction). It requires 4 bytes memory space. Derived data type of float are double, long double
Char: Char represents dingle alphabet and symbols (e.g. ‘A’, ’f’, ’@’). It requires 1 bytes memory space.
Void: Void data type has no value. It is used as return type for functions that do not return a value.
Predefined data type: int, float and char
Derived data type: array, string, structure etc.
Int : Int represents integer number ( number without fraction). It requires 2 Bytes memory space. Derived data types of int are short int, long int.
Float: Float represents real number ( number with fraction). It requires 4 bytes memory space. Derived data type of float are double, long double
Char: Char represents dingle alphabet and symbols (e.g. ‘A’, ’f’, ’@’). It requires 1 bytes memory space.
Void: Void data type has no value. It is used as return type for functions that do not return a value.
Post a Comment