title: How to find the factors of a number with for loops?
body: <p>Hey I need some help with my AP Comp Sci homework. In the assignment I need to print the factors of a passed variable, z. This is what I've gotten so far in my method</p>
  
  <pre><code>public static void printFactors(int z) {
      for(int x=1; x&lt;=z; x++) {
          if(z%x.......) {
              System.out.println(x);
          }
      }
  }
  </code></pre>
  
  <p>How would I go about finishing this? Or am I even on the right track? Thanks!</p>