title: Can't allocate an array dynamically of size 10
body: <p>I'm trying to dynamically allocate an array of size 10. But when I print the elements of the array, I get 
  value of 8 elements. (I'm working on the editor provided by hackerrank.) </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;math.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      char *s = malloc(1024*sizeof(char));
      scanf("%[^\n]", s);
      int* freq = (int*)calloc(10,sizeof(int));
      for(int i=0;i&lt;sizeof(freq);i++)
          printf("%d ",freq[i]);
      }
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>0 0 0 0 0 0 0 0 0 0
  </code></pre>
  
  <p>The output I'm getting: </p>
  
  <pre><code>0 0 0 0 0 0 0 0 
  </code></pre>
  
  <p>Why am I not getting the expected output?</p>