Describe four basic data type. How could we extend the range of value they represent?
Answers
Answer:
Floating point number are stored in 32 bits, with 6 digit of precision. Floating point numbers are denoted by the keyword float. Float number is not sufficient, the type double can be used to define the number. A double data type number uses 64 bits giving a precision of 14 digits. To extend the precision further, we may use long double which uses go bits.
Generally float occupies 4 bytes memory space and its value is limited to the range -3.4e38 to +3.4e38
General form:
float<variable name>;
float num1;
double num2;
long double num3;
Example:
450.45, 45.45, 45000.45
Void Type:
The void type has no values. This is usually used to specify the type of function. The type of function. The type of a function is said to be void when it does not return any value. The role of a generic type.