Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 1; i < 51; i++) {
- if (i % 15 == 0) {
- System.out.println("FIZZBUZZ");
- }
- else {
- if (i % 5 == 0) {
- System.out.println("BUZZ");
- }
- else {
- if (i % 3 == 0) {
- System.out.println("FIZZ");
- }
- else System.out.println(i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment