title: FizBuzz program: how to make the output correct?
body: <p>I got a question about this program, it says: <strong>The FizzBuzz Challenge: Display numbers from 1 to x, replacing the word 'fizz' for multiples of 3, 'buzz' for multiples of 5 and 'fizzbuzz' for multiples of both 3 and 5. Th result must be:1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 ...</strong></p>
  
  <p>So my problem is at the time to print the output, I dont know what to do.</p>
  
  <pre><code>public class Multiplos {
  
      public static void main(String args[]) {
  
          for (int i = 1; i &lt;= 100; i++) {
  
              if (i % 3 == 0) {
                  System.out.print(i + " ");
                  System.out.print(" fizz ");
              }
  
              if (i % 5 == 0) {
                  System.out.print(" " + i);
                  System.out.print(" " + "buzz ");
              }
  
              if((i % 3 == 0)&amp;&amp;(i % 5 == 0)){
                  System.out.print(i + " ");
                  System.out.print(" fizzbuzz ");
              }
  
          }
  
      }
  }
  </code></pre>