title: C - display char as hex
body: <p>I want to print the ASCII code of a char in hex; for example, for</p>
  
  <pre><code>char a = 0xA5;
  </code></pre>
  
  <p>I want to print <code>A5</code> on the console. Here is what I have tried:</p>
  
  <pre><code>char a = 0xA5;
  printf("%02X", a);
  </code></pre>
  
  <p>but i get <code>FFFFFFA5</code>. How could I solve this?</p>