C – Data Types

After reading this C data types topic, you will understand its classification and you will also able to use C data types.

Data Types Classification:

The data types classification in C language as shown below,

Fundamental Data types

These data types are predefined data types in C compiler shown below,

Fundamental Data TypesNumber of Bytes (size)Value RangeFormatExample
int2-32768 to 32767%dint sum =10;
char1-128 to 127%cchar a = 'K'
float43.4e-38 to 3.4e+38%ffloat a = 3.16;
double81.7e-308 to 1.7+308%lfdouble a =1.45;

Data Type Qualifier or Modifier

A fundamental data type change to new data type by using the qualifier (as signed, unsigned, short or long) with the fundamental data type.

Data Type QualifierNumber of Bytes (size)Value RangeFormatExample
unsigned char10 to 255%cunsigned char a = ‘a’;
unsigned int20 to 65535%uUnsigned int c = 3500;
long int4-2147483648 to 2147483647%ldlong int c = -2324;
unsigned long int40 to 4294967295%luunsigned long int c = 121345;
long double103.4e-4932 to 1.1e+4932%lflong double a = 5.32e-5;

Derived Data Types

These data types are derived from fundamental data types in C language. These are

 

Published by

Electrical Workbook

We provide tutoring in Electrical Engineering.

Leave a Reply

Your email address will not be published. Required fields are marked *