Thursday, 16 January 2014

WHAT IS DATA TYPE IN C LANGUAGE

Data types:

 Data types indicate the types of data a variable can have. A data types usually define a set of values, which can be stored in the variable along with the operations that may be performed on those values. C includes two types of data.
* Simple or Fundamental data type
* Derived data type

Simple Data Types:

 There are four simple data types in C.
* int
* char
* float
* double

int:- 

This means that the variable is an integer are stored in 2 bytes, may range from -32768 to 32767.

char:-

 This means that the variable is a character type, char objects are stored in one byte. If unsigned, the values may be in the range 0 to 255.

Float:-

 This means that the variable is a real number stored in 4 bytes or 32 bits. The range of floating point values are between 3.4E-38 to 3.4E38 or 6 significant digits after the decimal point.

Double:

 This means that the variable is a double precision float type. In most cases the systems allocates 8 bytes or 64 bits space, between 1.7E-308 to 1.7E308.

Derived Data Types:

 Derived data types are constructed from the simple data types and or other derived data types. Derived data include arrays, functions, pointers, references, constants, structures, unions and enumerations.

No comments:

Post a Comment