MCS-011 Problem Solving and Programming

First year, Semester 1

Chapters

Newsletter

Data types and Storage

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:

  1. Permissible range of values that it can store
  2. Memory requirement to store a data type

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 TypeDescriptionSizeRange
intInteger2 Bytes-32,768 to 32,767
charCharacter1 Byte-128 to 127
floatFloating Point Number4 Bytes3.4e-38 to 3.4e+38
doubleHigher Precision Float8 Bytes1.7e-308 to 1.7e+308

Memory requirements or size of data associated with a data type indicates the range of numbers that can be stored in the data item of that type. 

Report an issue

Reporting: Data types and Storage (topic)

Related Posts