The set of values and set of operations allowed to performed by a variable is called data type.It also declares the maximum and minimum range of values will be store in variable.
Types
Types
- Standard data type
- User define data type
Standard Data type
●
Int
● float
● double
● char
● float
● double
● char
Integer: It takes 2 bytes in memory location.
Maximum range 2+15 (32767)
Maximum range 2+15 (32767)
Minimum range 2-15
(-32768)
Types of Integer
● Short int
● Signed int
● un signed int
● long int
● un signed long int
Short int,signed int,unsigned int take 2 bytes in memory location and long int,unsigned long int take 4 bytes in memory.
Float
Only use to describe numbers with decimal points or fractional numbers.Always take memory location of 4 bytes.Give result up to six digit of precision after decimal point.
Maximum range 3.4×1038
Minimum range 3.4×10ˉ38
Double
It is a floating type variable with double precision,type double occupies eight bytes.Give result up to 15 digits.Maximum range 1.7×10308
Minimum range 1.7×10ˉ308
Long Double
Types of Integer
● Short int
● Signed int
● un signed int
● long int
● un signed long int
Short int,signed int,unsigned int take 2 bytes in memory location and long int,unsigned long int take 4 bytes in memory.
Float
Only use to describe numbers with decimal points or fractional numbers.Always take memory location of 4 bytes.Give result up to six digit of precision after decimal point.
Maximum range 3.4×1038
Minimum range 3.4×10ˉ38
Double
It is a floating type variable with double precision,type double occupies eight bytes.Give result up to 15 digits.Maximum range 1.7×10308
Minimum range 1.7×10ˉ308
Long Double
It
refers to the floating point data type that is often more precise than double
data type. Give result up to 19 digits. Always take memory of 10 bytes.
Maximum range 1.7×10 4932
Minimum range 1.7×10 ˉ4932
Maximum range 1.7×10 4932
Minimum range 1.7×10 ˉ4932
Char
Only use to declare single character value written in single quotation mark.Take memory of 1 byte.
signed -128 to 127 in ASCI
unsigned 0 to 255
Example 'A', '1', '$'
Only use to declare single character value written in single quotation mark.Take memory of 1 byte.
signed -128 to 127 in ASCI
unsigned 0 to 255
Example 'A', '1', '$'
No comments:
Post a Comment