Okay, so I'm trying to learn how to use the % operator, and I made a simple program that prints out [0] in a loop, and every ten times it goes to the next line, but the first time it doesn't.
this is the output:
[0][0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0]
this is what the output should be:
[0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0]
[0][0][0][0][0][0][0][0][0][0]
And this is the code:
public class RemainderLoop {
public static void main(String[] args) {
for(int i = 0; i < 50; i++){
System.out.print("[0]");
if((i%10) == 0 && i > 0)
System.out.print("\n");
}
}
}