![]() |
| What is Datatype in C language ? |
- What is Datatype in C language ?
- How many types of Datatype available in C language ?
- What is Primitive Datatype in C language ? detailed
Data Type in C:-
C language rich in data type,Storage representation and machine instruction to handle constants differ from machine to machine. The variety of data types available allow the programmer to select the appropriate to the need of the application as well as the machine.
ANSI C support three classes of data type:
- Primary(or fundamental) data type
- Derived data type
- User defined data type
The Primary Data type in C:-
The primary data type are also know as primitive or fundamentals data type of C language.All C compiler support five fundamental data type,namely integer(int),character(char),floating point(float),double precision floating point(double) and void.
Primitive Datatype is classified into following categories:
Integer(int) Datatype in C:-
Integer are whole number with a range of values supported by a particular machine.Generally,integer occupy one word of storage since word sizes of machine vary(typically 16 or 32 bit) the size of an integer that can be stored depends on the computer.
A signed integer use one bit for sign and 15 bits for magnitude of the number.similarly,a 32 bit word length can store ranging from -2,147,483,648 to 2,147,483,647.
C has three classes of integer storage,namely
- short int
- int
- long int
Floating(float) Point Datatype in C:-
floating point(or real) numbers are stored in 32 bits (on all 16 bit and 32 bit machines),with 6 digit of precision.Floating point numbers are defined in C by the keyword float.
When the accuracy provided by float number is not sufficient,the type double can be used to define the number.A double datatype number uses 64 bits giving a precision 14 digits.
Float datatype usually stored in 64 bits(4 byte) of internal storage.
Example: float a=12.34
Void Datatype in C:-

