elibraryportal Logo

Data Type in C

Data types are used to define a variable use in a program.

Data Type in C

Data Types:

There are four data types in C language that is

TypesData Types
Basic Data Type (Primary data types)int, char, float, double
Derived Data Type (Derived data types)array, pointer, structure, union
Enumeration Data Typeenum
Void Data Typevoid

Range of data types.

Data TypesMemory SizeRange
char1 byte−128 to 127
signed char1 byte−128 to 127
unsigned char1 byte0 to 255
short2 byte−32,768 to 32,767
signed short2 byte−32,768 to 32,767
unsigned short2 byte0 to 65,535
int2 byte−32,768 to 32,767
signed int2 byte−32,768 to 32,767
unsigned int2 byte0 to 65,535
short int2 byte−32,768 to 32,767
signed short int2 byte−32,768 to 32,767
unsigned short int2 byte0 to 65,535
long int4 byte-2,147,483,648 to 2,147,483,647
signed long int4 byte-2,147,483,648 to 2,147,483,647
unsigned long int4 byte0 to 4,294,967,295
float4 byte
double8 byte
long double10 byte
Next TopicC Keywords Rule