Thursday, 22 November 2012

Different-2 Data-Types in C Programming


By on 01:38

Data Type:-Data type is used to define a variable in a program(before it is used).

C has 4 type of 'data type' namely-


1)Primary Data type.
2)Secondary Data type.
3)User defined Data type.
4)Empty Data type.

1)Primary Data Type:-Primary data type also called as basic data type and built in data type.Some primary data type are-int,char,float,long etc.



Data type        Rangebytes  Format String
int-32768 to +32767     2     %d
char-128 to +127     1     %c
Float-3.4e38 to +3.4e38     4     %f
unsigned int0 to +65535     2     %u
unsigned char0 to +255     1     %c
long int-214783648 to +214783647     4     %ld
long unsigned int  0 to +4294967295     4     %lu
double-1.7e308 to +1.7e308     8     %lf
long double-1.7e4932 to +1.7e4932      10     %LF


2)Derived Data type:-The definition of derived data type is quite simple "those data type which are derived from the primary data type are called Derived Data type"

Example-union,array,structure,pointer,enum etc.

3)User-Defined Data type:-Those data-type which are defined by users.

Example:- typedef<basic data type><new data type>
Like:-typedef float fl;

4)Empty Data type:-Empty data types are those data types which return null value.

Example:-Void.


If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...