Data Types in C

A data type specifies the type of data that a variable can store such as integer, floating, character etc.

There are 4 types of data types in C language.

Type Data Types
Basic Data Types int, char, float, double
Derived Data Types array, pointer, function
User defined Data types structure, union, enum

Basic Data Types

The basic data types are integer-based and floating-point based. C language supports both signed and unsigned literals.
The memory size of basic data types may change according to 32 or 64 bit operating system.
Let's see the basic data types. Its size is given according to 32 bit architecture.
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/4 byte−32,768 to 32,767
signed int2/4 byte−32,768 to 32,767
unsigned int2/4 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