title: How to reduce if statements
body: <p>The program below functions as necessary but how do I reduce the amount of if statements. I have been told that if your function contains 2 or more if statements then your doing it wrong. Any suggestions? I've tried using switch statements but that hasn't worked because the case can't be a boolean.</p>
  
  <pre><code>for(int i = 1; i &lt; 100; i++)
          {
          if(i % 10 == 3) 
          {
              System.out.println("Fizz" + "(" + i + ") 3%10");
          }
  
          if(i / 10 == 3)
          {
              System.out.println("Fizz" + "(" + i + ") 3/10");
          }
  
  
          if(i % 10 == 5) 
          {
              System.out.println("Buzz" + "(" + i + ") 5%10");
          }
  
          if(i / 10 == 5)
          {
              System.out.println("Fizz" + "(" + i + ") 5/10");
          }
  
          if(i / 10 == 7)
          {
              System.out.println("Fizz" + "(" + i + ") 7/10");
          }
  
          if(i%10 == 7)
          {
              System.out.println("Woof" + "(" + i + ") 7%10");
          }
  
          if(i % 3 == 0)
          {
              System.out.println("Fizz" + "(" + i + ") 3%==0");
          }
  
          if(i % 5 == 0)
          {
              System.out.println("Buzz" + "(" + i + ")5%==0");
          }
  
          if(i % 7 == 0)
          {
              System.out.println("Woof" + "(" + i + ")7%==0");    
          }
  
          if( (i % 7 !=0 ) &amp;&amp; (i % 3 !=0 ) &amp;&amp; (i % 5 !=0 )
                  &amp;&amp; (i % 10 !=3) &amp;&amp; (i % 10 !=5 ) &amp;&amp; (i%10 !=7 ) )
              System.out.println(i);
      }
  </code></pre>