Tuesday 3 March 2015

C Data Types


C Language Data Types:

The arithmetic data types in C are Integers and floating points.


Integer Data Type:- 

Here is the detail about the standard int types and their storage size and its range also.

int: it consumes 2 bytes in memory and its range is from -32,767 to +32,767.

long int: it consumes 4 bytes in memory its range is from -2,147,483,648 to +2,147,483,648.

Unsigned int: it consumes 2 bytes in memory its range is from 0 to 65,535.

Floating Points:

Here is the detail about the standard floating point types and their storage size and its range also.

float: it consumes 4 bytes in memory and its range is from 1.2E-38 to 1.2E38.
double float: it consumes 8 bytes in memory and its range is from 2.3E-308 to 2.3E308.
long double float: it consumes 4 bytes in memory and its range is from 3.4E-4932 to 3.4E4932.


Character Data Type:
Character(char) data type include characters e.g A,a,B,C,d etc. Each character consumes only 1 byte in memory.

String:
String includes the group of characters e.g a sentence or a phrase etc. Each character in sentence of phrase consumes 1 byte.

No comments:

Post a Comment