Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String args[]) {
- for(int i = 1; i < 101; i++)
- {
- if(i%3 == 0)
- {
- System.out.println("repetitive of 3");
- }
- else if(i%5 == 0)
- {
- System.out.println("repetitive of 5");
- }
- else if(i%5 == 0 && i%3 == 0)
- {
- System.out.println("repetitive of 3 and 5");
- }
- else{
- System.out.println(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement