Loading, please wait...

Integer data Types

Integers are whole numbers with a wide range of values that are machine dependent. Integer occupies 2 bytes memory space and its value range limited to -32768 to +32767.  Integer data type allows a variable to store numeric values. “int” keyword is used to refer integer data type. The storage size of int data type is 2 or 4 or 8 byte. It varies depending upon the processor in the CPU that we use.  If we are using a 16-bit processor, 2 bytes (16 bit) of memory will be allocated for int data type.

 

 

Type

Storage size (in bytes)

Value range

char

1

-128 to 127 or 0 to 255

unsigned char

1

0 to 255

signed char

1

-128 to 127

int

2 or 4

-32,768 to 32,767 or -2,147,483,648 to

2,147,483,647

unsigned int

2 or 4

0 to 65,535 or 0 to 4,294,967,295

short

2

-32,768 to 32,767

unsigned short

2

0 to 65,535

long

4

-2,147,483,648 to 2,147,483,647

unsigned long

4

0 to 4,294,967,295