title: Algorithm of checking if the number is prime
body: <p><strong>Hello everyone!</strong></p>
  
  <p>I came to this algorithm on how to check if number is prime and probably it's fine for me but I want to find out if it can be improved</p>
  
  <pre><code>bool isPrime(int num)
  {
      bool isPrime = 1;
      if (num &lt;= 0)
      {
          return 0;
      }
      if (num == 1)
      {
          return 0;
      }
      for (int i = 2; i &lt;= sqrt(num); ++i)
      {
          if (num % i == 0)
          {
              isPrime = 0;
          }
      }
  
      return isPrime;
  }
  </code></pre>
  
  <p><strong>Thanks in advance</strong></p>