title: Divisor Counter Program Yielding Strange Output
body: <p>I am trying to create a divisor counter program that will print out all values of N divided by a set of numbers ranging from 1 up to N (initial), while also incrementing a variable called "divisorcount" whenever N%intial=0. Below is the program I wrote:</p>
  
  <pre class="lang-java prettyprint-override"><code>    public static void main(String[] args) {
          int divcount;
          int initial;
          int divisorcount;
          Scanner userinpt = new Scanner(System.in);
          int N = userinpt.nextInt();
  
          for (initial = 1; initial &lt; N; initial++) {
              divisorcount = 0;
              System.out.print(N / initial);
  
              if (N % initial == 0) {
                  divisorcount++;
                  System.out.println(divisorcount);
              } 
          } 
      }
  </code></pre>
  
  <p>When I input the number 20 into the program I get the following result:
  <code>(20 //this is the input the following are outputs)
  201
  101
  651
  41
  322221
  111111111</code></p>
  
  <p><code>Process finished with exit code 0</code></p>
  
  <p>This isn't anywhere close to the output I wanted or expected and I have zero idea why I am getting this result. I tried changing the variables to different types such as long, float, and double to see if that would help but I still get wacky outputs with my code. What am I doing wrong? Particularly why is the code I wrote yielding these values.</p>