public class FizzBuzz { public static void main(String[] args) { // Set the maximum number to be counted up. int max = 100; // The loop for counting up numbers from 1. for (int i=1; i<=max; i++) { // If the number is a multiple of both 3 and 5, say "Fizz Buzz". if (i%3 == 0 && i%5 == 0) { System.out.println("FizzBuzz"); } // Otherwise, if the number is a multiple of both 3, say "Fizz". else if (i%3 == 0) { System.out.println("Fizz"); } // Otherwise, if the number is a multiple of both 3, say "Buzz". else if (i%5 == 0) { System.out.println("Buzz"); } // Otherwise, simply say the number. else { System.out.println(i); } } } }