Write an application that counts by three from 3 through 300 inclusive, and that starts a new line after every multiple of 30 (30, 60, 90, and so on).
public class Main
{
public static void main(String[] args) {
for(int i=3;i<300;i+=3){
System.out.print(i+" ");
if(i%30==0){
System.out.println("\n");
}
}
}
}
Comments
Leave a comment