title: My fahrenheit-celcius program ignores my if-else statement and changes value to 0 everytime I run the program
body: <p>My if-else statement doesn't seem to work, anyone have any ideas?</p>
  
  <p>So I created this simple Fahrenheit-Celcius conversion console app using C++. The program uses a simple if-else statement to determine which conversion they want, Fahrenheit-Celcius or Celcius-Fahrenheit.</p>
  
  <p>The code currently doesn't work, however, it instantly converts Celcius-Fahrenheit and completely ignores the <code>std::cin</code> I put to grab user input. Instead, they put in the value of 0 everytime I run the program.</p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  int main() {
      unsigned short int fahrenheit{}, celsius{};
      char unit;
  
      cout &lt;&lt; "Choose what unit you want to start with" &lt;&lt; endl;
      cin &gt;&gt; unit;
      if (unit == 'c') {
          cout &lt;&lt; "Enter the temperature in Celsius : " &lt;&lt; endl;
          cin &gt;&gt; celsius;
          fahrenheit = (celsius * 9.0) / 5.0 + 32;
          cout &lt;&lt; "The temperature in Fahrenheit : " &lt;&lt; fahrenheit &lt;&lt; endl;
  
      } else {
          cout &lt;&lt; "Enter the temperature in Fahrenheit : " &lt;&lt; endl;
          cin &gt;&gt; fahrenheit;
          fahrenheit = (celsius * 9.0) / 5.0 + 32;
          cout &lt;&lt; "The temperature in Celcius : " &lt;&lt; celsius &lt;&lt; endl;
      }
  
      std::cin.clear(); // reset any error flags
      std::cin.ignore(std::numeric_limits&lt;std::streamsize&gt;::max(), '\n'); // ignore any characters in the input buffer until we find an enter character
      std::cin.get(); // get one more char from the user
  
      return 0;
  }
  </code></pre>