title: Display the binary representation of a number in C?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/111928/is-there-a-printf-converter-to-print-in-binary-format">Is there a printf converter to print in binary format?</a>  </p>
  </blockquote>
  
  
  
  <p>Still learning C and I was wondering: </p>
  
  <p>Given a number, is it possible to do something like the following?</p>
  
  <pre><code>char a = 5;
  printf("binary representation of a = %b",a);
  &gt; 101
  </code></pre>
  
  <p>Or would i have to write my own method to do the transformation to binary?</p>