#include int main ( ) { unsigned int numToPrintInBase2 = 2863311530; /* alternating 1's and 0's */ unsigned int exp = 1; int k; /* can't declare variable in a loop header */ /* Compute the highest storable power of 2 (2 to the 31th). */ for (k=0; k<31; k++) { exp = exp * 2; } /* For each power of 2 from the highest to the lowest, print 1 if it occurs in the number, 0 otherwise. */ for (k=31; !(k=0); k--) { if (numToPrintInBase2 >= exp) { putchar ('1'); numToPrintInBase2 = numToPrintInBase2 - exp; } else { putchar ('0'); } exp = exp / 2; } putchar ('\n'); return 0; }