Storing "binary" data type in C program
<p>I need to create a program that converts one number system to other number systems. I used itoa in Windows (Dev C++) and my only problem is that I do not know how to convert binary numbers to other number systems. All the other number systems conversion work accordingly. Does this involve something like storing the input to be converted using %?</p>

<p>Here is a snippet of my work:</p>

<pre><code>case 2:
        {
            printf("\nEnter a binary number: ");
            scanf("%d", &amp;num);
            itoa(num,buffer,8);
            printf("\nOctal        %s",buffer);
            itoa(num,buffer,10);
            printf("\nDecimal      %s",buffer);
            itoa(num,buffer,16);
            printf("\nHexadecimal  %s \n",buffer);
            break;
        }
</code></pre>

<p>For decimal I used %d, for octal I used %o and for hexadecimal I used %x. What could be the correct one for binary? Thanks for future answers!</p>
