Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package selfexercise4;
- public class DivisibleBy5and6 {
- public static void main(String[] args) {
- int count = 1;
- for(int number = 100; number <= 1000; number++) {
- if(number % 5 == 0 && number % 6 == 0) {
- System.out.print(number + " ");
- count++;
- } else {
- while(count == 10) {
- System.out.println();
- count = 1;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement