title: How do you display "%5d" in C?
body: <p>How do you display the string "%5d" in C? I tried putting a backslash in front of the percent, but it won't print (and gave warnings). I tried Googling but to no avail. I guess this is too wide for me to find a specific answer.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  {
      int test = 40;
      printf("\%5.1d %5.1d", test); //this is the one
      printf("%5.1d", test);
      return 0;
  }
  </code></pre>
  
  <p>Any help?</p>