WHAT IS DATA TYPE?
A bit of Pattern which interprints the data is called as data type or data type is a storage format which have specific size or range of values.The data types are used for declaring variables, functions etc. in the program. In short we can say that it is a type of data.
Data types are of two types
- Primary data types &
- Secondary data types.
Primary data types
1)int -
“int” keyword is used for int data type.
It can store numeric values.
e. g -10,20,30 etc
The formatting character is %d.
It requires two bytes of memory.
2)char-
“char” keyword is used for char data type.
It is used to store a single char.
e. g -#,A,6,* etc (in a single quote mark)
The formatting character is %c.
It requires only one byte of memory.
3) float -
“float” keyword is used for float data type.
It is used to store fractional values.
e. g -2.5, 3.34, 4.16 etc.
The formatting character is %f.
It requires four bytes of memory.
4) double -
“double” keyword is used for double data type.
It is also used to store fractional values. But with more precision.Hence it is also called precision point no. Means its range is double than float.
e.g -444.5, 9234.6 etc
The formatting character is %F.
It requires eight bytes of memory.
5) void-
“void” keyword is used for void data type.
It is a empty data type.
The void states that the function does not returned any value.
Secondary data types
Pointer, structure, array, etc are secondary data types.
0 Comments:
Post a Comment