title: for loop count number of terms java
body: <p>Hey guys i'm stuck on count for a for loop... It should be easy, but for some reason i'm over thinking it or something!
  Any help would be awesome!</p>
  
  <p>i'm trying to get the total number of terms that passed through %2 and print them out, but when i try it my way it does 11223344556677889910 which i thought was weird! all i want to do is get to say (10). </p>
  
  <pre><code>int counter = 0 
  
  for (int i = 1; i &lt; 20; i++) {
      if (i % 2 == 1) {
          counter += 1;
      }
      System.out.print(counter);
  }
  </code></pre>
  
  <p>output is 112233445566778899</p>
  
  <p>can't use arrays or lists :\</p>