Skip to content

Instantly share code, notes, and snippets.

@learner-long-life
Created January 12, 2015 21:49
Show Gist options
  • Save learner-long-life/1dc111e2bf1eef128ad2 to your computer and use it in GitHub Desktop.
Save learner-long-life/1dc111e2bf1eef128ad2 to your computer and use it in GitHub Desktop.
public class FizzBuzz {
public static void main(String[] args) {
for (int i = 0; i < 100; i++) {
if (i % 3 == 0) {
System.out.println("fizz");
} else if (i % 5 == 0) {
System.out.println("buzz");
} else if ((i % 3 == 0) && (i % 5 == 0)) {
System.out.println("fizzbuzz");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment