// calc_bin_rep_solution3.c - quick and dirty

#include <stdio.h>

//------------------------------------------------------------
int main()
{
  int num;
  unsigned bitmask = 0x1 << ((sizeof(int) * 8) - 1);
  printf("Please enter a number: ");
  scanf("%d",&num);

  while(bitmask)
  {
    if (num & bitmask)
      printf("1");
    else
      printf("0");
    bitmask >>= 1;
  }
  printf("\n");
  return(0);
}
