Introduction
C supports various data types for processing information. There is a family of integer data types and floating-point data types. Characters are stored internally as integers, and they are interpreted according to the character set. The most commonly used character set is ASCII. In the ASCII character set, A is represented by the number 65.
Program/Examples
The data type families are as follows:
Integer family
char data type
int data type
short int data type
long int data type
These data types differ in the amount of storage space allocated to their respective variables. Additionally, each type has two variants, signed and unsigned, which will be discussed later.
Float family (real numbers with decimal points)
Float data type
Double data type
(ANSI has also specified long double, which occupies the same storage space as double)
Explanation
1. Data type determines how much storage space is allocated to variables.
2. Data type determines the permissible operations on variables.
Points to Remember
1. C has two main data type families: integer for representing whole numbers and characters of text data, and float for representing the real-life numbers.
2. Each family has sub-data types that differ in the amount of storage space allocated to them.
3. In general, the data types that are allocated more storage space can store larger values.
No comments:
Post a Comment