title: Issue with loop repeating one more time than it should
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      char terminate;
      double a, b, answer;
      char operators;
  
      cout &lt;&lt; "Please enter your expression: ";
      terminate = cin.peek();
      cin &gt;&gt; a &gt;&gt; operators &gt;&gt; b;
  
      while (terminate != 'q')
      {
          switch(operators)
          {
              case '+':
                  answer = a + b;
                  break;
              case '-':
                  answer = a - b;
                  break;
              case '*':
                  answer = a * b;
                  break;
              case '/':
                  answer = a / b;
                  break;
              case '^':
                  answer = pow(a,b);
                  break;
          }
  
          cout &lt;&lt; a &lt;&lt; " " &lt;&lt; operators &lt;&lt; " " &lt;&lt; b &lt;&lt; " = " &lt;&lt; answer &lt;&lt; endl;
  
          cout &lt;&lt; "Please enter your expression: ";
          cin.clear();
          terminate = cin.peek();
          cin &gt;&gt; a &gt;&gt; operators &gt;&gt; b;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>This is my simple calculator program, it is meant to repeat and ask the user to enter a binary expression until the value "q" is entered, however upon entering "q" the while loop still executes once more even though the variable terminate has the value of "q". I don't understand why it is doing this, any help would be appreciated. Thanks</p>