title: C#: operator '-' cannot be applied to operands of type 'string' and 'int' error
body: <p>So I have almost completed my program but I keep getting this error for the subtraction operator. I have searched throughout my book and the internet but can find no fix for this. Is anybody able to tell me what is wrong with this code?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace ConsoleApplication14
  {
  class Program
  {
      static void Main(string[] args)
      {
          int int1;
          int int2;
          char oper;
  
          Console.Write("Enter first integer: ");
          int1 = Convert.ToInt32(Console.ReadLine());
  
          Console.Write("Enter operator (+,-,*, / or %)");
          oper = Convert.ToChar(Console.ReadLine());
  
          Console.Write("Enter first integer: ");
          int2 = Convert.ToInt32(Console.ReadLine());
  
          if(oper == '+')
              Console.Write("Answer is: " + int1 + int2);
  
          if (oper == '-')
              Console.Write("Answer is: " + int1 - int2);
  
          if(oper == '*')
              Console.Write("Answer is: " + int1 * int2);
  
          if(oper == '/')
              Console.Write("Answer is: " + int1 / int2);
  
          if(oper == '%')
              Console.Write("Answer is: " + int1 % int2);
  
          Console.ReadKey();
      }
  }
  </code></pre>
  
  <p>} </p>