title: How to count total appearance of 0 or 1 from range number 1 to n?
body: <p>So, I want to find how many digit 0 or 1 appear in a range of number. For example:
  I want to find how many 0 appear from number 1 to 100. The answer is, 0 appear 11 times. I want to implement it to C, but I don't know how to do it.</p>
  
  <p>So, the first thing I want is to receive an input type int(assume the int is n). Then, from number 1 to n, how many 0 appear in those range, and how many 1 appear in those range. Then print the total of how many 0 appear and how many 1 appear.</p>
  
  <p>This is what I've tried, but not complete yet.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int N, totalZero = 0;
  
      scanf("%d", &amp;N);
      for (int i=N; i&gt;0; i--)
      {
          //statement
      }
      return 0;
  }
  </code></pre>
  
  <p>I don't know what I must do int the //statement inside the for.</p>