C program to find the size of an integer, to find the size of any variable associated with any datatype, sizeof() operator will be used.

The following program shows the size of short, int, long and long long datatypes. 

#include <stdio.h>

int main(void) {
//format specifier %lu indicates unsigned int or unsigned long
    printf("\n size of short: %lu", sizeof(short));
    printf("\n size of int: %lu", sizeof(int));
    printf("\n size of long int: %lu", sizeof(long));
    printf("\n size of long long int: %lu", sizeof(long long)); 
    return 0;
}

OUTPUT:

 size of short: 2
 size of int: 4
 size of long int: 4
 size of long long int: 8

The sizes of data types might vary compiler to compiler. In my case int and long are 4 Bytes, short is 2 Bytes and long long takes 8 Bytes of storage for variables.