C examples for Data Type:int
For each type that stores signed integers, there is a corresponding type that stores unsigned integers.
The unsigned type occupies the same amount of memory as the signed type.
Each unsigned type name is the signed type name prefixed with the keyword unsigned.
The following table shows the basic unsigned integer types that you can use.
Type name | Number of bytes |
---|---|
unsigned char | 1 |
unsigned short or unsigned short int | 2 |
unsigned int | 4 |
unsigned long or unsigned long int | 4 |
unsigned long long or unsigned long long int | 8 |
A 32-bit integer variable can represent any of 4,294,967,296 different values.
Here are examples of unsigned integer variable declarations:
#include <stdio.h> int main(void) { unsigned int count; unsigned long population; count = 1000;/*from w ww . ja v a 2s .co m*/ printf("%d",count); return 0; }