I have to write a program in C that will print a table of decimal, binary, octal, and hexadecimal equivalents. I know how to get the program to print the octal and hex, but I don't know how to get it to convert decimal to binary and print the binary.

Basically I want it to print a table like this:

Decimal Octal Hex Binary
0 0 0 0
1 1 1 0001


all the way up to 15.

Can anyone help?