1 public class DivideThree { 2 public static void main(String args[]) { 3 int num; 4 int count = 0; 5 for(int i = 0; i < 99; i++) { 6 if(i%3 == 0) { 7 System.out.println(i); 8 count++; 9 } 10 if(count == 5) { 11 break; 12 } 13 } 14 } 15 }