206k views
1 vote
Write a Java program called Pattern that prints an 8-by-8 checker box pattern using a For loop structure as follows:

# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #
# # # # # # # #

1 Answer

3 votes

public class JavaApplication79 {

public static void main(String[] args) {

int count = 0;

for(int i = 0; i < 64; i ++){

if (count == 8){

System.out.println("");

count = 0;

}

System.out.print("#");

count ++;

}

}

}

I hope this helps!

User Matt Walterspieler
by
5.0k points