title: Why does the array print zero in the beginning with the last digit missing?
body: <p>I am trying to separate digits of a number and print those individual digits. When I do this -:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #define size 100
  
  int main()
  {
      int num, remainder, arr[size], i=0;
  
      printf(&quot;Enter a number : &quot;);
      scanf(&quot;%d&quot;, &amp;num);
  
      while(num != 0)
      {
          remainder = num%10;
          arr[i]=remainder;
          i++;
          num /= 10;
      }
  
      for(int j=i; j&gt;0; j--)
          printf(&quot;%d\t&quot;, arr[j]);
  
      printf(&quot;\n&quot;);
  
      return 0;
  }
  </code></pre>
  <p>It shows -:</p>
  <p><a href="https://i.stack.imgur.com/n6K4a.png" rel="nofollow noreferrer">Output</a></p>
  <p>I don't know the reason as to why it's happening. Please help me.</p>
  <p>Thank You.</p>