Skip to content

Instantly share code, notes, and snippets.

@DexterHaslem
Last active December 1, 2017 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DexterHaslem/a6353cd3184796cf792c9d82146faab7 to your computer and use it in GitHub Desktop.
Save DexterHaslem/a6353cd3184796cf792c9d82146faab7 to your computer and use it in GitHub Desktop.
java fizzbuzz
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
IntStream.range(1, 101).forEach(i -> System.out.println(String.format("%d %s%s", i, i % 3 == 0 ? "Fizz" : "", i % 5 == 0 ? "Buzz" : "")));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment