title: printf("%2d") in C programming
body: <p>I saw so many question and answer on stackoverflow and other sites but I am so confused that when %2d created 2 character spaces and we want to execute this code then what should happen?</p>
  
  <pre><code>int a = 20011;
  printf("%2d\n",a);
  </code></pre>
  
  <p>According to my point of view it should print only 2 character wide but when we print then it print whole character. Why?</p>
  
  <p>I have edited this question.
  Now I would like to know that what is used of - sign. I have read so many articles that says - sign tells the left alignment but when it is used give with example.
  for example:</p>
  
  <pre><code>int str[] = "skgskg";
   printf("%2s\n",str);
  </code></pre>