CC Data Types
Basic data types.
C Data Types
As explained in the Variables chapter, a variable in C must be a specified data type, and you must use a format specifier inside the printf() function to display it:
| Data Type | Size | Description |
|---|---|---|
| int | 2 or 4 bytes | Stores whole numbers, without decimals |
| float | 4 bytes | Stores fractional numbers, containing one or more decimals. Sufficient for storing 6-7 decimal digits |
| double | 8 bytes | Stores fractional numbers, containing one or more decimals. Sufficient for storing 15 decimal digits |
| char | 1 byte | Stores a single character/letter/number, or ASCII values |
Examples
Basic Data Types
c exampleSet Decimal Precision
c example