Powered By Blogger

Friday 11 January 2013

Data Types!

Data Type defines which type of data we are actually using in our C program, for example if you want to make a program, which simply add two numbers ,so the number should contain an integer value or for example: 2,3,4,5,....
The 2,3... like Digits called Integers.
 
We have generally two types of data types:
 
1.Fundamentals
2.Derived
 
Fundamental Data Types are the base of other data types ,most commonly used data types in any C program.They are:
int, float, char
"int" stores only integer values (2,3,4,.....)
"float" stores Decimal values (2.3,3.4,....)
"char" stores character type values (a, b, A, B, ....)

 Storage Requirement for Fundamental Data types in memory:

 

Data

Bytes Consume

Range Min

Range Max

Char

1

-128

127

Int

4

-2^31

(2^31)-1

float

4

6 digit of precision

6 digit of precision


Derived Data Types are the type of data types which are actually modification of Fundamental Data Types:
short int, long int, double float
 Storage Requirements for Derived Data types in memory:

Data

Bytes Consume

Range Min

Range Max

short int

2

-2^15

(2^15)-1

long Int

4

-2^31

(2^31)-1

double float

8

6 digit of precision

12 digit of precision

No comments:

Post a Comment