title: C programming array index out of bound
body: <p>Please give your view about array out of bounds....if i m taking big array output is correct bit for 20 array size....printing garbage value</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
      int message[200],i,j,n,count,temp;
      count=0;
      scanf("%d",&amp;n);
      //input taking line
      for(i=1; i&lt;=n; i++)
          scanf("%d",&amp;message[i]);
      for(i=1; i&lt;=n; i++)
      {
          if(message[i]==1)
          {
              count+=1;
          }
          if(message[i]==0)
              count=0;
  
          if(count==5)
          {
              count=0;
              temp=message[i+1];
              message[i+1]=0;
              //n=n+1;
              //n1=n;
              for(j=(n); j&lt;(i+2); j--)
              {
                  message[j+1]=message[j];
              }
              n++;
              message[i+2]=temp;
          }
      }
  
      printf("line\n");
      //n1+=1;
      for(i=0; i&lt;n; i++)
      {
          printf("%d\n",message[i]);
      }
      //n1+=1;
      return 0;
  
  }
  </code></pre>
  
  <p>thanks for any help...</p>