title: Displayed number deleted in array is not correct
body: <p>I have this program where it lets the user input an array of numbers.</p>
  <p>For example, I would input an array size of 4 and input the numbers 40, 20, 1, and 8 as the elements in the array.</p>
  <pre><code>Input array size: 4
  Input array elements: 40 20 1 8
  </code></pre>
  <p>The program also lets the user delete any elements from the array and the output should also show the element that was deleted.</p>
  <p>For example, I would delete the number 40 from the elements. The output should be like this:</p>
  <pre><code>Enter the position of the element that you would like to delete: 1
  The element 40 is completely deleted!
  </code></pre>
  <p>But instead of showing 40, the output goes like this:</p>
  <pre><code>Enter the position of the element that you would like to delete: 1
  The element 20 is completely deleted!
  </code></pre>
  <p>Here is my source code:</p>
  <pre><code>    int a[100];
      int arraySize, elementPosition;
  
      printf(&quot;\n Input Array Size: &quot;);
      scanf(&quot;%d&quot;, &amp;arraySize);
  
      printf(&quot;\n Input Array Elements: &quot;);
      for(i = 0; i &lt; arraySize; i++)
      {
          scanf(&quot;%d, &quot;, &amp;a[i]);
      }
  
      printf(&quot;\n Enter the position of the element you would like to delete: &quot;);
      scanf(&quot;%d&quot;, &amp;elementPosition);
  
      int deletedElement = a[elementPosition];
  
      if (elementPosition &gt;= arraySize + 1)
      {
          printf(&quot;\n \n \t Invalid position! Enter numbers from 1 to %d only.\n&quot;, arraySize);
          getch();
          del();
      }
      else
      {
          for (i = elementPosition; i &lt; arraySize - 1; i++)
          {
              a[i] = a[i+1];
          }
          printf(&quot;\n \The element %d is completely deleted!&quot;, deletedElement);
          arraySize = arraySize - 1;
          getch();
      }
  </code></pre>
  <p>It would be a very big help if someone can point out where did I go wrong.</p>