#include #include main () { long int i=1,j=i; /* title */ puts("Bits\tRange"); puts("----\t-----"); /* O/P data and calc the next * set of values */ for (i=1; i<=32; i++) { printf("%2ld\t0-%12lu\n", i, j*=2); } } /************************************************************************ * Bits Range * ---- ----- * 1 0- 1 * 2 0- 3 * 3 0- 7 * 4 0- 15 * 5 0- 31 * 6 0- 63 * 7 0- 127 * 8 0- 255 * 9 0- 511 * 10 0- 1023 * 11 0- 2047 * 12 0- 4095 * 13 0- 8191 * 14 0- 16383 * 15 0- 32767 * 16 0- 65535 * 17 0- 131071 * 18 0- 262143 * 19 0- 524287 * 20 0- 1048575 * 21 0- 2097151 * 22 0- 4194303 * 23 0- 8388607 * 24 0- 16777215 * 25 0- 33554431 * 26 0- 67108863 * 27 0- 134217727 * 28 0- 268435455 * 29 0- 536870911 * 30 0- 1073741823 * 31 0- 2147483647 * 32 0- 4294967295 */