In this tutorial we will learn about data types of C programming.
Data types are sets (ranges) of values that have similar characteristics.
Data Types are charaterized by :
Name – for example, int; Size (how much memory they use) – for example, 4 bytes; Default value – for example 0.
C language supports four pre-defined primitive types – char, int, float, void
-128 to +127
2 or 4 byte
-32,768 to 32,767 or -2,147,483,648 to +2,147,483,647
1.2E-38 to 3.4E+38
int variable_name; // int is used for integer datatypes
float variable_name; // float is used for integer datatypes
char variable_name; // char is used for integer datatypes
A derived data type is defined using combination of qualifiers along with the primitive data type.
Qualifiers are optional add-on to the basic data types. They are used to alter the behavior and property of basic data types yielding new type with new property and behavior. Types of qualifier: size and sign.
[sign-qualifier] [size-qualifier] <basic-data-type>
Parts in the square brackets  are optional and parts in angle bracket <> are mandatory.
unsigned short int
How size qualifier alter the behavior
Defines min 2 bytes integer
Defines a min 4 bytes integer
Defines a min 12 bytes double precision floating point number
User Defined Type
These data types are custom type created based on our need.
User defined type include array, pointer, structures, unions, enumeration types etc.
For example, let’s define a structure
Here, we can create our own defined data type using structure student:
struct student std;
In above example, student is uer-defined where std is variable that hols name, roll and marks of as student.