Data types in C

What is Data Type in C Programming ?

  • A Data Type is a Type of Data.
  • Data Type is a Data Storage Format that can contain a Specific Type or Range of Values.
  • When computer programs store data in variables, each variable must be assigned a specific data type.

Some of the Data Types Supported by C :-

Data TypekeywordDescription
Integer Data TypeintStores the Integer Value
Float Data TypefloatStores the Floating Point Value
Character Data TypecharStores the Single Character Value
Long Data TypelongStores the Long range Integer Value
Double Data TypedoubleStores the long range Floating Value


Explanation :-

  • Whenever we declare variable in Computer’s memory, Computer must know the type of the data to be stored inside the memory.
  • If we need to store the single character then the size of memory occupied will be different than storing the single integer number.
  • The memory in our computers is organized in bytes. A byte is the minimum amount of memory that we can manage in C.
  • A byte can store a relatively small amount of data one single character or a small integer (generally an integer between 0 and 255).

Size Required to Store Variable of Different Data Types:-

Data TypeBorland C/C++ CompilerVisual C++
Integer2 Bytes4 bytes
Float4 Bytes4 Bytes
Character1 Byte1 Byte
Long4 Byte8 Byte
Data types in C Data types in C Reviewed by ANAND PANDEY on 2:03:00 AM Rating: 5

No comments:

Created By Anand Pandey. Powered by Blogger.