title: C++ beginner - simple outputs
body: <p>Here I have simple code to serve as a calculator for integers. </p>
  
  <pre><code>//Calculator, by Michael Lowry
  
  #include &lt;iostream&gt;
  using namespace std; 
  
  void main ()
  {
      int input = 0;
      int input2 = 0;
      int answer = 0;
      int operation = 0;
  
      cout &lt;&lt; "Enter your first number" &lt;&lt; endl;
      cin &gt;&gt; input;
  
      cout &lt;&lt; "Type 1 for addition, 2 for subtraction, 3 for multiplication, or 4 for division" &lt;&lt; endl;
      cin &gt;&gt; operation;
  
      cout &lt;&lt; "Enter your second number" &lt;&lt; endl;
      cin &gt;&gt; input2;
  
      if (operation = 1)
      {
          input + input2 == answer;
      }
  
      if (operation = 2)
      {
          input - input2 == answer;
      }
  
      if (operation = 3)
      {
          input * input2 == answer;
      }
  
      if (operation = 4)
      {
          input / input2 == answer;
      }
  
      cout &lt;&lt; "Your answer is " &lt;&lt;
      cout &lt;&lt; answer &lt;&lt; endl;
      system ("PAUSE");
  }
  </code></pre>
  
  <p>When I enter "1" for all three inputs, I get the output "Your answer is 6121DBCC0". Why is my answer variable all messed up?</p>