title: Not able to pass value properly
body: <p>Newbie here. In this program I was trying to make a function named <code>bitcount</code> where I would count bits, where I will the get value from <code>main</code> function but its throwing some garbage value when compiled.</p>
  <pre><code>#include&lt;stdlib.h&gt;
  #include&lt;stdio.h&gt;
  
  int main()
  {
      int a,n;
      printf(&quot;Enter a number&quot;);
      scanf(&quot;%d&quot;, a);
      n = bitcount(a);
      printf(&quot;the count is %d&quot;,n);
      return 0;
  }
  
  int bitcount(unsigned x)
  {
      int i,n;
      for(i = 0; x != 0; x &gt;&gt;= 1)
          if(x &amp; 01)
      n++;
      return n;
  }
  </code></pre>
  <p>And also why can't we simply use <code>(x &amp; 1)</code> in place of <code>(x &amp; 01)</code>.</p>