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