title: logical error in deletion of an element from a queue implemented as an array
body: <p>I was making this program for implementing a queue as an array, i am able to successfully insert values into the queue, but when i go for deletion of an element, the following happens : 
   suppose i inserted the following into the queue : 1,2,3
  now i wish to delete an element(the whole thing happens according to FIFO mechanism as we all know)</p>
  
  <p>so,
  expected output : 2,3 </p>
  
  <p>actual output : (blank)</p>
  
  <p>I HAVE AN IMAGE ATTACHED(OF THE OUTPUT SCREEN) AS WELL.</p>
  
  <p>i think that it may be a logical error, i cant figure it out.
  I would be glad if anyone of you helped me out.
  Thanks!!</p>
  
  <p>THE CODE GOES LIKE : <a href="https://i.stack.imgur.com/Ahpak.png" rel="nofollow noreferrer">This image</a></p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;conio.h&gt;
  using namespace std;
  
  int Remove(int[]);
  int Insert(int[], int);
  void Display(int[], int, int);
  
  int front = -1, rear = -1;
  
  void main()
  {
      const int size = 50;
      int Q[size];
      int item, res;
      char ch = 'y';
      while (ch == 'y' || ch == 'Y')
      {
          cout &lt;&lt; "\n Enter item for insertion : ";
          cin &gt;&gt; item;
          res = Insert(Q, item);
          if (res == -1)
          {
              cout &lt;&lt; "\n OVERFLOW!";
              _getch();
          }
          cout &lt;&lt; "\n Now the Queue is : ";
          Display(Q, front, rear);
          cout &lt;&lt; "\n Do you wish to insert more elemens into the array(y/n)? 
  : ";
          cin &gt;&gt; ch;
      }
      cout &lt;&lt; "\n Now the deletion of elements from the Queue begins....";
      ch = 'y';
      while (ch == 'y' || ch == 'Y')
      {
          res = Remove(Q);
          if (res == -1)
          {
              cout &lt;&lt; "\n UNDERFLOW!";
              _getch();
          }
          else
          {
              cout &lt;&lt; "\n The element deleted from the Queue is : " &lt;&lt; res &lt;&lt; 
  endl;
              cout &lt;&lt; "\n Now, the Queue(Front--to--Rear) is : ";
              Display(Q, front, rear);
          }
          cout &lt;&lt; "\n Do you wish to delete more elements from the Queue(y/n)? 
  : ";
          cin &gt;&gt; ch;
      }
      _getch();
      return;
  }
  
  int Insert(int Q[], int ele)
  {
  
      const int size = 50;
      if (rear == size - 1)
      {
          return -1;
      }
      else
      {
          if (rear == -1)
          {
              front = rear = 0;
              Q[rear] = ele;
          }
          else
          {
              rear++;
              Q[rear]=ele;
          }
          return 0;
      }
  }
  
  int Remove(int Q[])
  {
      int ret;
      if (front == -1)
      {
          return -1;
      }
      else
      {
          ret = Q[front];
          if (front = rear)
          {
              front = rear = -1;
          }
          else
          {
              front++;
          }
      }
      return ret;
  }
  
  void Display(int Q[], int front, int rear)
  {
      if (front == -1)
      {
          return;
      }
      for (int i = front; i &lt; rear; i++)
      {
          cout &lt;&lt; Q[i] &lt;&lt; " &lt;- ";
      }
      cout &lt;&lt; Q[rear] &lt;&lt; endl;
  }
  </code></pre>