Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Mod3And5 {
- public static void main(String args[]) {
- for (int i = 1; i <= 100; i++) {
- String out = "";
- if (i % 3 == 0) {
- out += "Fizz";
- }
- if (i % 5 == 0) {
- out += "Buzz";
- }
- if (out == "") {
- out = String.valueOf(i);
- }
- System.out.println(out);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement