title: Why does my if statement not run even if the condition is met?
body: <p>I tried to make a simple program that asks the user a question and if the user answers correctly, it tells them that they are correct, but if they don't, it tells them to try again, and the code runs again. I did this using a while loop, if they answer correctly it breaks out of the while loop. But when i tested it even when i get the correct answer, it doesn't break out of the loop.</p>
  <pre class="lang-cpp prettyprint-override"><code>    #include &lt;iostream&gt;
      
      int main() {
          int answer;
          while (1 &lt; 2) {
              std::cout &lt;&lt; &quot;What is 3 + 5?&quot;;
              answer = std::cin.get();
              if (answer == 8) {
                  std::cout &lt;&lt; &quot;You are correct!&quot;;
                  break;
              }
              else {
                  std::cout &lt;&lt; &quot;Wrong answer! Try again&quot;;
              }
          }
      }
  </code></pre>