To store data inside the computer we need to first identify the type of data elements we need in our program. There are several different types of data, which may be represented differently within the computer memory. The data type specifies two things:
C Language provides four basic data types viz. int, char, float and double. Using these, we can store data in simple ways as single elements or we can group them together and use different ways (to be discussed later) to store them as per requirement.
| Data Type | Description | Size | Range |
|---|---|---|---|
| int | Integer | 2 Bytes | -32,768 to 32,767 |
| char | Character | 1 Byte | -128 to 127 |
| float | Floating Point Number | 4 Bytes | 3.4e-38 to 3.4e+38 |
| double | Higher Precision Float | 8 Bytes | 1.7e-308 to 1.7e+308 |