Integer Data
An integer data is a whole numeric value with no decimal part. It includes both positive and negative values. Some examples of integer values are 1, 12, -3, 58, and -19.
Data Types for Integers
The data types used in C for storing integer values are as follows:
i) int ii) short int iii) long int
iv) unsigned int v) unsigned long int
i) The int Data Type
The 'int' data type is used to store integer values. It takes 2 bytes in memory. The 'int' type variables can store values from -32768 to 32767.
ii) The short int Data Type
The "short int" data type also takes 2 bytes in memory for storing integer value. It can store values from -32768 to 32767. The "short int" data type can also be written as "short".
iii) The long int Data Type
The "long int" data type takes 4 bytes in memory for storing large integer value. It can store values from -2147483648 to 2147483647. The "long int" data type can also be written as "long".
iv) The unsigned int Data Type
The "unsigned int" data type is used to store unsigned integer values only i.e. positive values. It takes 2 bytes in memory. It can store values from 0 to 65535. The "unsigned int" data type can also be written as "unsigned".
No comments:
Post a Comment
Thanks For Visiting Here...!! I will Reply you as soon as possible.