title: Finding the smallest integer that is a factor of C?
body: <p>I need help with this method
  smallestFactor</p>
  
  <p><code>public static int smallestFactor(int C)</code>
  This function takes as its argument an integer C, and it returns the smallest integer that is a factor of C, other than 1.</p>
  
  <p>Parameters:  C - An integer to factor.</p>
  
  <p>Precondition: C must be greater than 1.</p>
  
  <p>Returns: The smallest factor of C.</p>
  
  <pre><code>public class Factor
  {       
  public static long smallestFactor(int C)
      {   
      for (int i = 2; i*i&lt;= C; i++) 
      {   
          while (C % i == 0) 
          {
           System.out.print(i + " "); 
           C = C / i;
          }
      }
          return C;
      }
  }
  </code></pre>
  
  <p>I need to find the smallest Factor 
  but I'm not sure how to do it</p>