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 Type | keyword | Description |
---|---|---|
Integer Data Type | int | Stores the Integer Value |
Float Data Type | float | Stores the Floating Point Value |
Character Data Type | char | Stores the Single Character Value |
Long Data Type | long | Stores the Long range Integer Value |
Double Data Type | double | Stores 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 Type | Borland C/C++ Compiler | Visual C++ |
---|---|---|
Integer | 2 Bytes | 4 bytes |
Float | 4 Bytes | 4 Bytes |
Character | 1 Byte | 1 Byte |
Long | 4 Byte | 8 Byte |
Data types in C
Reviewed by ANAND PANDEY
on
2:03:00 AM
Rating:
No comments: