title: How to count number of element in an int type array where 0 can be an element?
body: <p><strong>Expectation</strong>:  I want to count number of element available in an <code>int</code> type of array where <code>0</code> can be an element.</p>
  
  <p>Following program output:</p>
  
  <pre><code>Total Element :6
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>Total Element :9
  </code></pre>
  
  <p>The code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
  
      int a[50] = { 1, 2, -3, 0, 0, 6, 7, -8, 0 };
      int count = 0;
  
      int i = 0;
      for (i = 0; i &lt; 50; i++) {
          if (a[i]) {
              count++;
          }
      }
      printf("Total Element :%d ", count);
  
      return 0;
  }
  </code></pre>
  
  <p>NB: I want to count the total number of elements in the array. I do not want to count the size of the array.</p>