Answer:
The basic four data
types are:
Data Type
|
||||
Integer Type
|
Character Type
|
Floating Point Type
|
Void Type
|
|
signed
int
short int
long int
|
unsigned
unsigned int
unsigned short int
unsigned long int
|
char
signed char
unsigned char
|
float
double
long double
|
|
Integer Type:
Integer are whole
number with a range of values supported by a particular machine. Integer occupy
one word of storage and since the word sizes of machines size of an integer
that can be stored depends on the computer.Generally an integer occupies 2
bytes memory space and its value is limited to the range -32768 to +32767.
General form:
int<variable name>;
int num1;
short int num2;
long int num3;
Example:
450, 45, 45000.
Character Type:
A single character can
be defined as a character type data characters are usually stored in 8 bits of
internal storage while unsigned chars have values between 0 and 225, signed
chars have values from -128 to +127.
General form:
char<variable name>;
char ch=’a’;
Example:
a,b,M,R,m;
Floating Point Type:
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.