Listing 5 Packs a date into an int with bitwise operations

/* bit1.c: Pack a date into an integer */
#include <stdio.h>

main()
{
   unsigned int date, year = 92, mon = 8, day = 2;

   date = (year << 9) | (mon << 5) | day;
   printf("%04X\n", date);
   return 0;
}

/* OUTPUT:
 * B902 */

/* End of File */