BinaryView as PDF
Your computer science teacher has kindly requested that you write a program to convert a number, inputted in decimal, to binary to help in teaching students about binary. Also to aid in human processing of numbers, you should group every four bits and separate the groups by space.
The first line will be integer (), the number of numbers to convert to binary. The next lines will be such that ().
For every integer , output the binary representation, grouped into four bit groups, separated by spaces. If necessary, you must pad the first group to have exactly four bits.
3 1 10 255
0001 1010 1111 1111