title: How to exclude zero in a for loop in Java
body: <p>I'm trying to exclude the zero in this nested for loop here using != 0; but it is not doing anything. I'm trying to get the probability of each out come of 2 six sided dice when rolled. I must figure out the amount of times they are rolled first, but a die doesn't have a zero in it, so I must exclude it. I can't figure out why this doesn't work.</p>
  
  <pre><code>for( die2 = 0; die2 &lt;= 6 &amp;&amp; die2 != 0; die2++)
              for( die1 = 0; die1 &lt;= 6 &amp;&amp; die1 != 0; die1++)
                  System.out.println("Die 2: " + (die2 * userInputValue) + " " + "Die 1: " +       (die1 * userInputValue));
  </code></pre>