title: Array is showing different output in C
body: <p>Here is a code in C language I got stuck.</p>
  <pre><code>#include&lt;stdio.h&gt;
  
  int main(){
      int Force_V[2], w;
      int i, j, Disp_V[2];
      printf(&quot;Enter Force Vector: &quot;);
      for(i=0; i&lt;=2; i++){
          scanf(&quot;%d&quot;, &amp;Force_V[i]);
      }
      printf(&quot;Enter Displacement Vector: &quot;);
      for(j=0; j&lt;=2; j++){
          scanf(&quot;%d&quot;, &amp;Disp_V[j]);
      }
      printf(&quot;Force vector: %di+%dj+%dk&quot;, Force_V[0],Force_V[1],Force_V[2]);
      printf(&quot;\nDisplacement vector== %di+%dj+%dk&quot;, Disp_V[0],Disp_V[1],Disp_V[2]);
  
      w= (Force_V[0]*Disp_V[0])+(Force_V[1]*Disp_V[1])+(Force_V[2]*Disp_V[2]);
  
      printf(&quot;The work: %df&quot;, w);
  
      return 0;
  
  }
  </code></pre>
  <p>output for Force_V[2] is showing the output of Disp_V[0]. Can anyone tell me where's the error?</p>