title: End program after breaking from loop
body: <pre><code>while (1)
  {
      cout &lt;&lt; "Enter number and unit: ";
      cin &gt;&gt; number;
      cin &gt;&gt; unit;
  
      if (unit == "in")
      {
          result = 2.54f * number;
          cout &lt;&lt; number &lt;&lt; " Inches are " &lt;&lt; result &lt;&lt; " centimeters!" &lt;&lt; endl;
      }
      else if (unit == "ft")
      {
          result = 0.3f * number;
          cout &lt;&lt; number &lt;&lt; " Feet are " &lt;&lt; result &lt;&lt; " meters!" &lt;&lt; endl;
      }
      else if (unit == "yd")
      {
          result = 0.9f * number;
          cout &lt;&lt; number &lt;&lt; " Yards are " &lt;&lt; result &lt;&lt; " meters!" &lt;&lt; endl;
      }
      else if (unit == "mi")
      {
          result = 1.6f * number;
          cout &lt;&lt; number &lt;&lt; " Miles are " &lt;&lt; result &lt;&lt; " kilometers!" &lt;&lt; endl;
      }
      else
      {   
          cout &lt;&lt; "\tINVALID!!!\n...the program will now exit...\n";
          cin.clear();
          cin &gt;&gt; unit;
          cin &gt;&gt; number;
          break;
      }
  }
  
  cout &lt;&lt; "Thank you for using English to Metric!\n" &lt;&lt; endl;
  
  return 0;}
  </code></pre>
  
  <p>What am I missing in order to get the last cout and exit the program without having to input anything after break?</p>