Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - public class FizzBuzz {
- public static void main(String[] args) {
- int a = 1;
- int arr[][] = new int[7][15];
- for (int i = 0; i < 7; i++) {
- for (int j = 0; j < 15; j++) {
- if (a <= 100) {
- arr[i][j] = a;
- a++;
- if ((j == 2) || (j == 5) || (j == 8) || (j == 11)) {
- System.out.print("Fizz ");
- } else if ((j == 4) || (j == 9)) {
- System.out.print("Buzz ");
- } else if ((j == 14)) {
- System.out.print("FizzBuzz ");
- } else {
- System.out.print(arr[i][j] + " ");
- }
- }
- }
- }
- }
- }
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment                    
                 
                    