title: Time complexity of this primality testing algorithm?
body: <p>I have the following code which determines whether a number is prime:</p>
  
  <pre><code>public static boolean isPrime(int n){
      boolean answer = (n&gt;1)? true: false;
  
      for(int i = 2; i*i &lt;= n; ++i)
      {
          System.out.printf("%d\n", i);
          if(n%i == 0)
          {
              answer = false;
              break;
          }
      }
      return answer;      
  }
  </code></pre>
  
  <p>How can I determine the big-O time complexity of this function? What is the size of the input in this case?</p>