title: Checking for a prime number
body: <p>I'm having problems with a task. I need to find and alert the user if the number is prime or not.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>int a = Convert.ToInt32(number);
  
  if (a % 2 !=0 )
  {
      for (int i = 2; i &lt;= a; i++)
      {
          if (a % i == 0)
          {
              Console.WriteLine("not prime");
          }
          else
          {
              Console.WriteLine("prime");
          }
          Console.WriteLine();
      }
  }
  else
  {
      Console.WriteLine("not prime");
  }
  Console.ReadLine();
  </code></pre>
  
  <p>Where did I go wrong, and how can I fix it?</p>