Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EX1 {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- for (int i=1; i<=110; i++)
- {
- if(i%12==0)
- System.out.println();
- if(i%3==0)
- System.out.print("Boom ");
- else if (i%5==0)
- System.out.print("Bam ");
- else if (i%7==0)
- System.out.print("Bim ");
- else if (i%15==0)
- System.out.print("BoomBam ");
- else if (i%21==0)
- System.out.print("BoomBim ");
- else if (i%35==0)
- System.out.print("BamBim ");
- else if (i%105==0)
- System.out.print("BoonBamBim ");
- else
- System.out.print(i + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement