"Z Code Writer" is an Online Blog for Programmer & Beginner. Here, You will Find tech, Build your Programming Skills and other Programming Language Like C, C++, HTML, Java Script Java Code, Web Designing and University Of Sialkot (USKT) CGPA / GPA Calculator etc.

Wednesday, 3 July 2019

Integer Data And Thier Types

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".

v) The unsigned long Data Type

      The "unsigned long" data type is used to store large unsigned integer values only i.e. positive values. It takes 4 bytes in memory. It can store values from 0 to 4294967295. The "unsigned long" data type can also be written as "unsigned long int".

No comments:

Post a Comment

Thanks For Visiting Here...!! I will Reply you as soon as possible.