public class DivisibleBy5For{
public static void main(String[] args){
int count = 0;
for(int i = 1; i <= 1000; i++){
if(i % 5 == 0){
System.out.print(i + "\t");
count ++;
}
if(count % 3 == 0){
System.out.println();
}
}
}
}
public class DivisibleBy5While{
public static void main(String[] args){
int count = 0;
int i = 1;
while(i <= 1000){
if(i % 5 == 0){
System.out.print(i + "\t");
count ++;
}
if(count % 3 == 0){
System.out.println();
}
i++;
}
}
}